Skip to content

Instantly share code, notes, and snippets.

View marcoslhc's full-sized avatar
🏳️‍🌈
He's like the rainbow

Marcos Hernández marcoslhc

🏳️‍🌈
He's like the rainbow
View GitHub Profile
@marcoslhc
marcoslhc / css_sticky_footer_test.html
Created November 20, 2011 13:59
CSS Sticky footer Original by http://ryanfait.com/
@marcoslhc
marcoslhc / dabblet.css
Created December 19, 2011 15:58
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height:100%;
@marcoslhc
marcoslhc / htmlentitycodes.py
Created September 27, 2012 22:46
generate html entity codes
import re
from htmlentitydefs import codepoint2name
# convert unicode or string to raw
def raw(s):
# raw function thanks to stackoverflow.com/users/1438542/balbc
if isinstance(s, str):
@marcoslhc
marcoslhc / gist:3837598
Created October 5, 2012 01:46
garber-irish implementation
/*
Usage:
<script src="path/to/js/garber-irish-implementation.js">
<body data-controller="users" data-action="show">
*/
SITENAME = {
common: {
init: function() {
// application-wide code
}
@marcoslhc
marcoslhc / gist:3890047
Created October 14, 2012 22:45
Various forms to create an unique identifier by hash digest
#Taken from http://stackoverflow.com/questions/8996820/how-to-create-md5-hash-in-bash-in-macos
echo "this will be encrypted" | md5
# 72caf9daf910b5ef86796f74c20b7e0b
md5 <<< 'this will be encrypted'
# 72caf9daf910b5ef86796f74c20b7e0b
md5 -s 'this will be encrypted'
# MD5 ("this will be encrypted") = 502810f799de274ff7840a1549cd028a
@marcoslhc
marcoslhc / gist:3909289
Created October 18, 2012 01:05
Using node.js in webfaction
#taken from //community.webfaction.com/questions/4888/install-nodejs-with-express-framework
#the "forever" part taken from //shkfon.tumblr.com/post/27178918675/real-world-nodejs-part-1
#thanks to [Ryan s](http://community.webfaction.com/users/16/ryans/) and [Dave Stevens](http://shkfon.tumblr.com/)
mkdir -p $HOME/src
cd $HOME/src
wget 'http://nodejs.org/dist/v0.8.9/node-v0.8.9.tar.gz'
tar -xzf node-v0.8.9.tar.gz
cd node-v0.8.9
@marcoslhc
marcoslhc / gist:4129412
Created November 22, 2012 04:25
Git driven website 2

A web-focused Git workflow

After months of looking, struggling through Git-SVN glitches and letting things roll around in my head, I’ve finally arrived at a web-focused Git workflow that’s simple, flexible and easy to use.

Some key advantages:

  • Pushing remote changes automatically updates the live site
  • Server-based site edits won’t break history
  • Simple, no special commit rules or requirements
@marcoslhc
marcoslhc / gist:4137506
Created November 23, 2012 22:06
Installing virtualenv in webfaction Nov '12
mkdir -p ~/bin ~/lib/python2.7 ~/src
cd ~/src
ln -s $HOME/lib/python2.7 $HOME/lib/python
wget http://pypi.python.org/packages/source/v/virtualenvwrapper/virtualenvwrapper-3.6.tar.gz
tar zxf virtualenvwrapper-3.6.tar.gz
cd virtualenvwrapper-3.6
PYTHONPATH=$HOME/lib/python2.7 python2.7 setup.py install --home=$HOME
rm $HOME/lib/python
@marcoslhc
marcoslhc / gist:4148775
Created November 26, 2012 15:25
Some django cheat sheet listings
@marcoslhc
marcoslhc / gist:4158322
Created November 28, 2012 01:04
Non Blocking Javascript mercurytide whitepaper
<!DOCTYPE html>
<html>
<head>
<!--
Original from http://www.mercurytide.co.uk/news/article/how-improve-site-speed-part-1/
Modified by @author:Marcos Hernández; @email:marcoslhc@gmail.com
now you can load many libraries. The pattern follows order of requirements so the required libraries
must be declared first in libs[]
@Autor: Marcos Hernández @email:marcoslhc@gmail.com"