Skip to content

Instantly share code, notes, and snippets.

@JeffreyWay
JeffreyWay / grid.css
Created December 15, 2011 16:34
Simple CSS Grid in Stylus
full_width = 80
columns = 12
gutter = 1
.container
width unit(full_width, '%')
margin auto
overflow hidden
div[class^="grid_"]
@btoone
btoone / curl.md
Last active June 19, 2024 12:54
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@andypiper
andypiper / nuget.sh
Created May 8, 2012 16:18
nuget for OS X
#!/bin/sh
# add a simple 'nuget' command to Mac OS X under Mono
# get NuGet.exe binary from http://nuget.codeplex.com/releases/view/58939
# get Microsoft.Build.dll from a Windows .NET 4.0 installation
# copy to /usr/local/bin and Robert is your father's brother....
#
PATH=/usr/local/bin:$PATH
mono --runtime=v4.0 /usr/local/bin/NuGet.exe $*
@dangerbell
dangerbell / mocha-supertest-nock.coffee
Created November 1, 2012 20:10
Mocha Example with SuperTest and Nock
request = require 'supertest'
scope = require 'nock'
app = require process.cwd() + '/app.coffee'
backend = require process.cwd() + 'lib/backend.coffee'
URL =
describe 'Collections', ->
describe 'show', ->
it "should return a 404 if the object doesn't exist", (done) ->
scope = nock(backend.url)
@owainlewis
owainlewis / Example.hs
Last active June 1, 2020 20:30
Haskell HTTP GET request example
module Example () where
import Network.HTTP
-- Non HTTPS
-- 1. Perform a basic HTTP get request and return the body
get :: String -> IO String
get url = simpleHTTP (getRequest url) >>= getResponseBody
@atenni
atenni / README.md
Last active June 20, 2024 22:30
How to permalink to a gist's raw file

Problem: When linking to the raw version of a gist, the link changes with each revision.

Solution:

To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/

To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]

@deepak
deepak / gist:5933685
Created July 5, 2013 10:40
Set ENV in Dockerfile with string interpolation
# DOCKER-VERSION 0.4.8
FROM ubuntu:12.04
# install essentials
RUN apt-get install -y -q git
# Install rbenv
RUN git clone https://github.com/sstephenson/rbenv.git /usr/local/rbenv
RUN echo '# rbenv setup' > /etc/profile.d/rbenv.sh
@p1nox
p1nox / using_meld_on_mac.md
Last active June 13, 2023 16:24
Using meld on Mac

Using Meld merging tool on Mac

There are two ways of installing meld on osx (May 2023), using brew and .dmg package (from @yousseb). Since I found https://yousseb.github.io/meld/, I've installed it with .dmg package, but having macOS Ventura Version 13.4 (22F66) in place, it's not even starting for me. So I tried brew installation, and the application is working as expected, including symlink to start it from the terminal.

brew install --cask meld

# set meld as your default git mergetool
@puffnfresh
puffnfresh / nestedpromises.js
Created December 4, 2013 23:01
Promises as functors are useful.
var Promise = require('fantasy-promises'),
fl = "https://api.github.com/repos/fantasyland/",
// Pretend this URL is given by the user, not setTimeout
userInput = new Promise(function(resolve) {
setTimeout(function() {
resolve(fl + "fantasy-states");
}, Math.random() * 500);
}),
@nisaacson
nisaacson / .tern-project
Created February 26, 2014 17:23
Use tern with vim for node.js development.
{
"libs": [
"browser",
"underscore",
"jquery"
],
"plugins": {
"node": {}
}
}