Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
v1nce
Sep 19, 2004

Plant your brassicas in may and cover them in mulch.

Mecca-Benghazi posted:

I decided that I want to move my personal website (which has a rarely updated blog :effort:) from WordPress to some static pages, so I'm looking into using a static site generator and maybe hosting on GitHub Pages. The obvious answer is to use Jekyll, but I'm leaning towards using Hugo because Ruby on Windows is a headache and a half. Anyone have any thoughts about other static site generators or static site generators in general?

Odette posted:

You could always chuck Ubuntu on a VM, and have full access to all static generators.

This exactly. For example, you can get up and running with Sculpin (PHP) via the following:

1. Install Vagrant and VirtualBox
2. git clone https://github.com/pulkitjalan/vagrant-sculpin.git blog-vm
3. git clone https://github.com/sculpin/sculpin-blog-skeleton.git blog-vm/www/blog
3. vagrant up
4. vagrant ssh
5. cd /home/vagrant/www/blog && sculpin install && serve
6. open http://192.168.10.10:8000
7. Learn to use sculpin.

Disclaimer: I haven't tested this procedure :v:

Edit: Here's the equivalent for Jekyll.
Edit2: And this one for Hugo? There's no readme :(

VMs are awesome.

v1nce fucked around with this message at 04:02 on Mar 7, 2016

Adbot
ADBOT LOVES YOU

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Mecca-Benghazi posted:

I decided that I want to move my personal website (which has a rarely updated blog :effort:) from WordPress to some static pages, so I'm looking into using a static site generator and maybe hosting on GitHub Pages. The obvious answer is to use Jekyll, but I'm leaning towards using Hugo because Ruby on Windows is a headache and a half. Anyone have any thoughts about other static site generators or static site generators in general?

I love Pelican, which is Python. Only one I've ever used, so I can't compare it to others, but I really like it.

Mecca-Benghazi
Mar 31, 2012


I should clarify that I'm completely fine with command line, adding stuff to my PATH, git, etc, and I've already got cygwin added to my PATH (so I can run everything through Powershell :unsmigghh:). It's just that Jekyll itself seems to be a particular pain on Windows.

Why VirtualBox over Hyper-V, which is built in to Windows?

The appeals of Hugo for me were speed at actually making the static HTML pages and the fact that it's just one executable that I can add to the PATH, nothing else required. This is the same cross-platform, no need to build it.

Lumpy posted:

I love Pelican, which is Python. Only one I've ever used, so I can't compare it to others, but I really like it.
Pelican looks cool, thanks. I'm already pretty comfortable with Python, don't know why I didn't think to look for ones in Python. :sweatdrop:

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Mecca-Benghazi posted:

Why VirtualBox over Hyper-V, which is built in to Windows?

Using Hyper-V makes it start up on boot as your main Windows' hypervisor, so what you think is your root OS is actually a guest on the system. That probably doesn't really matter unless you want to use a different VM product because you won't be able to without rebooting with it disabled, but it's something to consider.

Sedro
Dec 31, 2008

Mecca-Benghazi posted:

Why VirtualBox over Hyper-V, which is built in to Windows?
Either one works. VirtualBox has more support from the community. For comparison, here's the most popular vagrant boxes for the two providers:

quote:

Virtualbox
ubuntu/trusty64 Official Ubuntu Server 14.04 LTS (Trusty Tahr) builds
12,441,795 downloads | 20160303.0.0 | last release 3 days ago

Hyper-v
hashicorp/precise64 A standard Ubuntu 12.04 LTS 64-bit box.
4,790,146 downloads | 1.1.0 | last release 2 years ago

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
So, Transactional Email Services. One of my clients has had their little Email Marketing program from a non descript company crap out from licensing and now the company is unreachable, so they need something better. They DON'T need anything that manages the contacts, segments them, or anything like that. All they need is a way to add templates, and upload an .xls/csv/whatever with the mail merge variables, and then have all that stuff go out. I could write an integration with Mandrill myself but I ain't got time for that, nor is it something I really would like to build the UI for if someone has already done it way better.

I'm well aware of stuff that supports bulk sending over API, having templates, but not sure which ones support a simple mail merge using an uploaded CSV, and the marketing bullet points make it kinda impenetrable to find out for sure what they mean. Does anyone know of a service that definitely has csv importing to mail merge?

DarkLotus
Sep 30, 2001

Lithium Hosting
Personal, Reseller & VPS Hosting
30-day no risk Free Trial &
90-days Money Back Guarantee!

Maluco Marinero posted:

So, Transactional Email Services. One of my clients has had their little Email Marketing program from a non descript company crap out from licensing and now the company is unreachable, so they need something better. They DON'T need anything that manages the contacts, segments them, or anything like that. All they need is a way to add templates, and upload an .xls/csv/whatever with the mail merge variables, and then have all that stuff go out. I could write an integration with Mandrill myself but I ain't got time for that, nor is it something I really would like to build the UI for if someone has already done it way better.

I'm well aware of stuff that supports bulk sending over API, having templates, but not sure which ones support a simple mail merge using an uploaded CSV, and the marketing bullet points make it kinda impenetrable to find out for sure what they mean. Does anyone know of a service that definitely has csv importing to mail merge?

FYI, since you mentioned Mandrill, it's going away as a standalone service and now requires a paid mailchimp account to use mandrill as an addon.

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
Yeah, I'm aware of that one too. Tbh already steering towards mailgun for transactional as an easy answer if my clients don't use any service. Mailgun has worked well enough for low volume. Price is right too.

v1nce
Sep 19, 2004

Plant your brassicas in may and cover them in mulch.

Mecca-Benghazi posted:

I should clarify that I'm completely fine with command line, adding stuff to my PATH, git, etc, and I've already got cygwin added to my PATH (so I can run everything through Powershell :unsmigghh:). It's just that Jekyll itself seems to be a particular pain on Windows.

As fun as it is to hack your own machine to bits to make things run, you're missing the point of why VMs are great:

- Portable. You give the VM spec to someone else and they get exactly the same box.
- Disposable. If it stops working, you just burn it down and build it again.
- Customisable. You can modify the provisioning of the VM to include all your favourite tools, set up just-so. This also lowers the cost of entry, as other people can use that same VM to get started without needing to know how to install everything.
- Agile. Because it's both disposable the customisable, it's really easy to incrementally change things in the box and try new configurations, upgrade versions, etc.

These points are less pertinent for static site generators, but still marginally relevant. Once you start taking steps beyond your basic web stack, VMs become a lot more necessary.

Mecca-Benghazi posted:

Why VirtualBox over Hyper-V, which is built in to Windows?
Portability. People in the OSS community tend to design VMs for VirtualBox because it's free and on all platforms. It's generally more inclusive.
The steps I specified in my previous post are the same for everyone on every supported OS.

stoops
Jun 11, 2001
I have this search form on my homepage with fields: location, type, and priceFrom and priceTo

The type is a dropdown and the prices are textboxes.

My problem is that the prices are acting like the TYPE dropdown, meaning, when i click on the textboxes, the Type dropdown comes up.

I found that the solution may be in this style

code:
media="all"
.dsidx-resp-area input[type="text"], .dsidx-resp-area select {
    width: 100%!important;
}
On inspection, when i uncheck that width, the price boxes work.

My problem is, the stylesheet the code is on is on an outside cdn.

I guess i can copy down that stylesheet and remove it manually, but is there a way where i can override the width and say don't use a width?

I find if i put in width=0px, the dropdown doesn't work for the type.

if it doesn't make any sense, i can post up a dev link

Any help is appreciated.

Anmitzcuaca
Nov 23, 2005

unfortunately because it has the !important declaration it will be harder than normal to override, any other rule that targets the width will also need to have important, and you would want to make sure that your rule to override it is loaded after the css from the CDN. If your stylesheet from the CDN is loaded in the head, it might be best to inline your override on the element.

Spatulater bro!
Aug 19, 2003

Punch! Punch! Punch!

I got inspired and put this together: A Complete Guide to CSS Grid Layout. Perhaps some of you may find it useful.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

caiman posted:

I got inspired and put this together: A Complete Guide to CSS Grid Layout. Perhaps some of you may find it useful.

What a great domain/name combo!

v1nce
Sep 19, 2004

Plant your brassicas in may and cover them in mulch.

caiman posted:

I got inspired and put this together: A Complete Guide to CSS Grid Layout. Perhaps some of you may find it useful.

Aside from the great guide, I'm loving the idea of collapsing the introduction and terminology portions of the article, so you can just start reading about the tech. Ace.

Diabolik900
Mar 28, 2007

v1nce posted:

Aside from the great guide, I'm loving the idea of collapsing the introduction and terminology portions of the article, so you can just start reading about the tech. Ace.

I can't seem to expand the collapsed sections on mobile though.

Spatulater bro!
Aug 19, 2003

Punch! Punch! Punch!

Diabolik900 posted:

I can't seem to expand the collapsed sections on mobile though.

Hmm. What device and browser are you using?

Anyone else having this problem?

Diabolik900
Mar 28, 2007

caiman posted:

Hmm. What device and browser are you using?

iPhone 6s+ Safari.

v1nce
Sep 19, 2004

Plant your brassicas in may and cover them in mulch.

Diabolik900 posted:

iPhone 6s+ Safari.

Apparently something to do with mobile safari and the click event:
http://www.shdon.com/blog/2013/06/07/why-your-click-events-don-t-work-on-mobile-safari

Not sure if it can be solved by just changing the .collapsible-control:hover with the cursor rule to just .collapsible-control?

Spatulater bro!
Aug 19, 2003

Punch! Punch! Punch!

Diabolik900 posted:

iPhone 6s+ Safari.

Would you mind please checking it again? I've taken v1nce's suggestion.

Diabolik900
Mar 28, 2007

caiman posted:

Would you mind please checking it again? I've taken v1nce's suggestion.

Works now! Thanks.

Spatulater bro!
Aug 19, 2003

Punch! Punch! Punch!

Diabolik900 posted:

Works now! Thanks.

Awesome. Big thanks to v1nce for the link and the suggestion. Makes me realize how much I need to set up a device lab.

Data Graham
Dec 28, 2009

📈📊🍪😋



Anmitzcuaca posted:

unfortunately because it has the !important declaration it will be harder than normal to override, any other rule that targets the width will also need to have important, and you would want to make sure that your rule to override it is loaded after the css from the CDN. If your stylesheet from the CDN is loaded in the head, it might be best to inline your override on the element.

Ffffuuuu, up until just now I assumed "!important" meant "not important", and never bothered trying to use it (because it's not important) :doh:

DICTATOR OF FUNK
Nov 6, 2007

aaaaaw yeeeeeah

Data Graham posted:

Ffffuuuu, up until just now I assumed "!important" meant "not important", and never bothered trying to use it (because it's not important) :doh:
I'm curious: what did you assume it's purpose was?

Data Graham
Dec 28, 2009

📈📊🍪😋



I thought it was a thing browsers could choose to ignore if they wanted to or something. Like, rather than just being a keyword that gets ignored because browsers don't recognize it, they could recognize it but opt to fall through it under certain circumstances that I didn't put much thought into speculating about.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Well you avoided a misfeature, so that's not so bad.

Spatulater bro!
Aug 19, 2003

Punch! Punch! Punch!

Is the iPhone version of Safari identical to the iPad version? I'm thinking about buying an Apple device for site testing and I'm leaning towards an iPad.

kedo
Nov 27, 2007

caiman posted:

Is the iPhone version of Safari identical to the iPad version? I'm thinking about buying an Apple device for site testing and I'm leaning towards an iPad.

If you have a Mac, Xcode comes with a device simulator and costs $0.

Spatulater bro!
Aug 19, 2003

Punch! Punch! Punch!

kedo posted:

If you have a Mac, Xcode comes with a device simulator and costs $0.

I don't. :(

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!
I have been trying to use localstorage (or sessionstorage) to store the contents of a JSON and no matter what I look up or try it doesn't return anything, or maybe null, or maybe undefined :bang:

I just want to run a function that uses a JSON object, first checks if it's localstorage, if it is, great, use it, if not go to the url via .ajax and save it, then use it, yes I know I need to stringify the contents.

kedo
Nov 27, 2007

caiman posted:

I don't. :(

Bummer. Well, if you're looking at an iPad you're already going to spend about half the price of a refurbished laptop. It's hard to beat testing on a physical device, but I'd rather pay the few extra hundred dollars to be able to simulate and test on any Apple device rather than on just one.

Sadly I don't have an answer to your original question. :\

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



caiman posted:

Is the iPhone version of Safari identical to the iPad version? I'm thinking about buying an Apple device for site testing and I'm leaning towards an iPad.

I know they handle video elements slightly differently, but that's the only thing I'm sure of.

For testing, get a mac mini and run the emulators and connect to them in Safari for a decent debugging experience. Otherwise you have to maintain an OSX VM to debug and that's a pain in the rear end.

spacebard
Jan 1, 2007

Football~

The Merkinman posted:

I have been trying to use localstorage (or sessionstorage) to store the contents of a JSON and no matter what I look up or try it doesn't return anything, or maybe null, or maybe undefined :bang:

I just want to run a function that uses a JSON object, first checks if it's localstorage, if it is, great, use it, if not go to the url via .ajax and save it, then use it, yes I know I need to stringify the contents.

Are you in private browsing mode? I think that disables local (or maybe session storage). Some devices also limit how much you can store.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



spacebard posted:

Are you in private browsing mode? I think that disables local (or maybe session storage). Some devices also limit how much you can store.

IIRC you don't have to be in Incognito or equivalent because some privacy options kill localstorage, too. Disabling third party cookies in Chrome will, I think.

Oh and every browser will disable it differently, so that's fun.

Skandranon
Sep 6, 2008
fucking stupid, dont listen to me

Munkeymon posted:

IIRC you don't have to be in Incognito or equivalent because some privacy options kill localstorage, too. Disabling third party cookies in Chrome will, I think.

Oh and every browser will disable it differently, so that's fun.

Incognito in Chrome (desktop anyways) won't disable LocalStorage, it's just a separate LocalStorage from all other Chrome tabs, and is automatically cleared as soon as the last Incognito window is closed.

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
Yeah, it's safari that does things the dumb way IMO, throwing exceptions if you try to use local storage in private browsing. I have no idea why this is still a problem in 2016, when you can just wipe the storage when the private tab clears or whatever.

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!
Things came up and I wasn't able to work on it.

I tried switching to sessionStorage since that should still be good enough for what I'm trying to accomplish, but it's still not working.
Testing all of your theories about incognito, I hardcoded a value and it works (the commented out line), so I'm guessing it has to do with some failure in terms of my coding for AJAX/scope/closure:
code:
var savedJSONTree = window.sessionStorage.getItem("jsonTree");
console.log("value is: "+savedJSONTree);
if (savedJSONTree == null){
	console.log("getting from server")
	//window.sessionStorage.setItem("jsonTree", "foo");	
	$.getJSON("/json/url", function(data) {
		window.sessionStorage.setItem('jsonTree',JSON.stringify(data));
	})
} else {
	console.log("getting from local")
}
savedJSONTree = window.sessionStorage.getItem("jsonTree");
console.log("value is: "+savedJSONTree);

Skandranon
Sep 6, 2008
fucking stupid, dont listen to me

The Merkinman posted:

Things came up and I wasn't able to work on it.

I tried switching to sessionStorage since that should still be good enough for what I'm trying to accomplish, but it's still not working.
Testing all of your theories about incognito, I hardcoded a value and it works (the commented out line), so I'm guessing it has to do with some failure in terms of my coding for AJAX/scope/closure:
code:
var savedJSONTree = window.sessionStorage.getItem("jsonTree");
console.log("value is: "+savedJSONTree);
if (savedJSONTree == null){
	console.log("getting from server")
	//window.sessionStorage.setItem("jsonTree", "foo");	
	$.getJSON("/json/url", function(data) {
		window.sessionStorage.setItem('jsonTree',JSON.stringify(data));
	})
} else {
	console.log("getting from local")
}
savedJSONTree = window.sessionStorage.getItem("jsonTree");
console.log("value is: "+savedJSONTree);

Just looking at the API for $.getJSON(), it looks like you are passing in your success function in the wrong spot (should be 3rd parameter, not 2nd. 2nd is a post object)

http://api.jquery.com/jquery.getjson/

Edit: Hmmm, their own example does it that way too. Are you sure your AJAX call is succeeding, and you're getting back the data you are expecting?

nexus6
Sep 2, 2011

If only you could see what I've seen with your eyes

The Merkinman posted:

Things came up and I wasn't able to work on it.

I tried switching to sessionStorage since that should still be good enough for what I'm trying to accomplish, but it's still not working.
Testing all of your theories about incognito, I hardcoded a value and it works (the commented out line), so I'm guessing it has to do with some failure in terms of my coding for AJAX/scope/closure:
code:
var savedJSONTree = window.sessionStorage.getItem("jsonTree");
console.log("value is: "+savedJSONTree);
if (savedJSONTree == null){
	console.log("getting from server")
	//window.sessionStorage.setItem("jsonTree", "foo");	
	$.getJSON("/json/url", function(data) {
		window.sessionStorage.setItem('jsonTree',JSON.stringify(data));
	})
} else {
	console.log("getting from local")
}
savedJSONTree = window.sessionStorage.getItem("jsonTree");
console.log("value is: "+savedJSONTree);

Have you tried using a library like localForage?

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!

nexus6 posted:

Have you tried using a library like localForage?
No, I might go that route eventually, but I'd hope not to include a whole library for what is now, one thing.

Skandranon posted:

Edit: Hmmm, their own example does it that way too. Are you sure your AJAX call is succeeding, and you're getting back the data you are expecting?
Yes, I use the same $.getJSON successfully elsewhere. I do it on pageload and on click, which is why I wanted to do local/session storage so it doesn't call the server every time.
Moreover, if I do a console.log immediately after setting the variable:
code:
window.sessionStorage.setItem('jsonTree',JSON.stringify(data));
console.log("ajax is: "+JSON.stringify(data))
it does indeed output what I want, but does so after the second "Value is" output.
code:
value is: null
getting from server
value is: null
ajax is: [{good stuff I want in here,[…]
That's why I think it's some scope or closure or asynchronous JavaScript function issue.

Adbot
ADBOT LOVES YOU

Skandranon
Sep 6, 2008
fucking stupid, dont listen to me

The Merkinman posted:

No, I might go that route eventually, but I'd hope not to include a whole library for what is now, one thing.

Yes, I use the same $.getJSON successfully elsewhere. I do it on pageload and on click, which is why I wanted to do local/session storage so it doesn't call the server every time.
Moreover, if I do a console.log immediately after setting the variable:
code:
window.sessionStorage.setItem('jsonTree',JSON.stringify(data));
console.log("ajax is: "+JSON.stringify(data))
it does indeed output what I want, but does so after the second "Value is" output.
code:
value is: null
getting from server
value is: null
ajax is: [{good stuff I want in here,[…]
That's why I think it's some scope or closure or asynchronous JavaScript function issue.

Oh... yes, you are doing the ajax part wrong. You are going to hit your "savedJSONTree = window.sessionStorage.getItem("jsonTree");" before your AJAX call returns, your Success function passed into $.getJSON is not blocking. You need to deal with this in a completely async way. Your "savedJSONTree = window.sessionStorage.getItem("jsonTree");" line should be IN your success callback.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply