Skip to content

Instantly share code, notes, and snippets.

View ErikFontanel's full-sized avatar

Erik Gelderblom ErikFontanel

View GitHub Profile
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active March 8, 2024 02:11
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@karlwestin
karlwestin / .gitconfig
Created May 23, 2011 13:34
Make git diff ignore whitespace and don't try to open jpgs and shit
# this can be put in [repo]/.git/config for local settings
# or ~/.gitconfig for global settings
# create a difftool "nodiff" that just returns true
# this path is for Mac. On linux it's /bin/true i guess
[diff "nodiff"]
command = /usr/bin/true
# make git ignore white space differences, many different possibilites here
@roelven
roelven / gist:2987639
Created June 25, 2012 09:35 — forked from matthewhudson/gist:1603502
Integrate Open Graph with Tumblr
<meta property="og:site_name" content="{Title}" />
<meta property="fb:app_id" content="FB_APP_ID" />
<meta property="fb:admins" content="FB_ADMIN_ID" />
<meta property="og:description" content="{MetaDescription}" />
<meta property="og:locale" content="en_US" />
{block:IndexPage}
<meta property="og:image" content="{PortraitURL-128}" />
<meta property="og:title" content="SITE_NAME" />
<meta property="og:type" content="blog" />
@alettieri
alettieri / wp_capistrano.rb
Created August 30, 2012 17:26
WordPress Capistrano deployment file (On Webfaction)
default_run_options[:pty] = true # Must be set for the password prompt from git to work
# WebFaction user account
# This is the server user account
set :server_user, "<server_username>"
# Server Domain
set :domain, "<domain_name>"
set :user, server_user
# Repository User
@kuzin
kuzin / mq.css
Created October 3, 2012 19:01 — forked from chriscoyier/mq.css
SCSS Media Queries with Retina Support
@mixin respond-to($media, $retina: true) {
// Settings
$small : 320px;
$medium : 700px;
$large : 1300px;
@if $media == 'small' {
@if $retina == true {
@media
@willurd
willurd / web-servers.md
Last active May 4, 2024 07:22
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@koenbok
koenbok / framer-canvas.js
Created October 16, 2013 18:25
Framer Canvas Example
var myCanvasView = new View({
x:100, y:100,
width:200, height:200
})
// Add a nice background color so we see it
myCanvasView.style.backgroundColor = "rgba(255,0,0,.5)"
// This is the tricky bit, we create a canvas element (so we have a reference to it) and insert it into the view
@zakhardage
zakhardage / Tiered Pricing for Shopify
Last active April 19, 2022 10:53
Shopify tiered pricing using javascript (non-app). This example has the quantity breaks controlled by theme settings.
// config -> settings.html
// Make sure you have the same number of quantity breaks as product variants
<fieldset>
<legend>Quantity Breaks</legend>
<table class="standard-table">
<tr><td>Enter quantity breaks in ascending order separated by a comma (e.g. 5, 10, 20, 50)</td><td><input type="text" name="breaks" size="50" /></td></tr>
</table>
</fieldset>
@yuchant
yuchant / viewport.coffee
Created January 25, 2014 02:33
Viewport Units with Coffee
class root.utils.ViewportHeight
'The VH unit is not well supported. Use data-tags instead.
data-viewport-unit="line-height: 100vh; height: 100vh;'
constructor: ({@element, @styles}={}) ->
@$element = $ @element
@$window = $ window
@_bindHandlers()
_getStyles: ->
@staltz
staltz / introrx.md
Last active May 3, 2024 13:00
The introduction to Reactive Programming you've been missing