Skip to content

Instantly share code, notes, and snippets.

View leostratus's full-sized avatar
⌨️
computering

Leo Stratus leostratus

⌨️
computering
View GitHub Profile
@leostratus
leostratus / gist:6732601
Created September 27, 2013 18:05
An argument against using open source (free) tools and services from someone in the natural sciences. Let's not make fun of them, let's figure out how to educate scientists on the merit of open-source software and how it can help with everything from code review to transparency of process. http://www.interdisciplinaryprogramming.com
I understand the younger generation thinks everything should be free.
Well, I grew up in a country where everything was actually free. (The few things we actually could have). A worker's paradise!
As you may have heard, that country is no more, and "everything is free" was a major reason for it's demise. (To this day, they are still dividing up all the formerly free stuff)
If any lesson I learned, it is that people who do stuff should be compensated for their work
and services (commonly acceptable unit of compensaton is called "money").
So all this talk about using services because they are free is crazy talk and it leads in the same direction the whole Soviet Union happily marched off.
@leostratus
leostratus / gist:5807770
Last active December 18, 2015 15:58
Copy-paste-able code for my Kensington slide clicker so that it works with my HTML/CSS slide deck. Note that if you have a Kensington remote with multiple modes that you'll want to be in 'emulate mouse' mode.
// This shit because my Kensington presentation clicker wasn't programmable
// Seriously I should have bought a Logitech
document.body.onclick = function(e) {
bespoke.prev(); // Change this to whatever function selects the previous slide for view for your deck
return false;
}
document.oncontextmenu = function (e) {
bespoke.next(); // Change this to whatever function selects the next slide for view for your deck
@leostratus
leostratus / fix-lion-postgres.sh
Created April 23, 2013 21:32
Moves your OS X default postgres binaries into an archive folder and symlinks the homebrew versions in place of them. Originally from http://nextmarvel.net/blog/2011/09/brew-install-postgresql-on-os-x-lion/
BREW_POSTGRES_DIR=`brew info postgres | awk '{print $1"/bin"}' | grep "/postgresql/"`
LION_POSTGRES_DIR=`which postgres | xargs dirname`
LION_PSQL_DIR=`which psql | xargs dirname`
sudo mkdir -p $LION_POSTGRES_DIR/archive
sudo mkdir -p $LION_PSQL_DIR/archive
for i in `ls $BREW_POSTGRES_DIR`
do
if [ -f $LION_POSTGRES_DIR/$i ]
@leostratus
leostratus / html-entities.md
Created September 21, 2012 18:37
HTML Entities/HTML Escape Characters

Because somehow I always end up trolling the interwebs looking for a reference for these.

Symbol Code Entity Name
@leostratus
leostratus / webkit-pseudo-elements.md
Created September 21, 2012 01:44
Webkit Pseudo-Element Selectors (Shadow DOM Elements)

An ongoing project to catalogue all of these sneaky, hidden, bleeding edge selectors as I prepare my JSConf EU 2012 talk.

Everything is broken up by tag, but within each the selectors aren't particularly ordered.

I have not tested/verified all of these. Have I missed some or got it wrong? Let me know. - A

A friendly reminder that you may need to set this property on your target/selected element to get the styling results you want:

-webkit-appearance:none;

@leostratus
leostratus / curl-tidy-xml
Created September 18, 2012 17:24
curl - command to retrieve tidy XML from an API endpoint in your terminal
curl -v -X GET "https://someAPIendpoint.com/?getStuff" | tidy -xml -utf8 -i
@leostratus
leostratus / high-ppi-media-queries.css
Created August 27, 2012 20:48
Media Query w/all vendor prefixes required for high PPI devices (eg. Retina display iPhone 4)
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (min--moz-device-pixel-ratio: 1.5),
only screen and (-o-device-pixel-ratio: 3/2),
only screen and (min-device-pixel-ratio: 1.5) {
/* High-res version of image assets go here */
}