Skip to content

Instantly share code, notes, and snippets.

View hew's full-sized avatar

Matt hew

View GitHub Profile
@michiel
michiel / cors-nginx.conf
Created July 5, 2011 10:41
Wide-open CORS config for nginx
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
@coldnebo
coldnebo / Default (OSX).sublime-keymap -- User
Created February 3, 2012 16:21
Sublime Text 2 fix for OSX home/end keys
{ "keys": ["home"], "command": "move_to", "args": {"to": "bol"} },
{ "keys": ["end"], "command": "move_to", "args": {"to": "eol"} }
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@tim-reynolds
tim-reynolds / jquery.centerit.js
Created June 29, 2012 18:16
Setting scroll to center on an element (jQuery) - Super simple stuff
/*
If you have a horizontal (or vertical) scroll container and want to set the scroll to center a specific
element in the container you can use the following super simple technique.
I'm going to show you how it was derived, because it's important to know why, not just how.
*/
/*
Setup:
[HTML]
<div class="outer">
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active May 2, 2024 03:13
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@dre1080
dre1080 / .powenv
Last active March 21, 2018 14:06
Using Pow!! with Foreman (Configuration)
# In your app's root.
# Make Pow!! export all the env variables contained in the .env file used by Foreman.
export $(cat .env)
@amaxwell01
amaxwell01 / .vimrc
Created November 6, 2012 23:31
My .vimrc file
"=== Colors ==="
colorscheme andrewmaxwell-1
syntax on
set number " Show line numbers
set cursorline " Highlight the currently selected line
set undolevels=1000 " Set undo amount to 1000
set ignorecase " Enable case insenstive search
set ruler " show current position at bottom
@niallo
niallo / app.js
Created March 2, 2013 00:43
Quick and dirty landing page & contact form server in node.js, uses hapi.js, swig and nodemailer.
var mailer = require('nodemailer')
var Hapi = require('hapi')
var util = require('util')
var template = require('swig')
var path = require('path')
var PORT = process.env.PORT || 8080
var server = new Hapi.Server(PORT)
template.init({
@dongyuwei
dongyuwei / horizontal-infinite-carousel.html
Created June 26, 2013 04:03
infinite loop carousel(vertical or horizontal)