Skip to content

Instantly share code, notes, and snippets.

View voxpelli's full-sized avatar

Pelle Wessman voxpelli

View GitHub Profile
@technoweenie
technoweenie / github_oauth_busy_developer_guide.md
Created May 30, 2010 18:34
GitHub OAuth Busy Developer's Guide

GitHub OAuth Busy Developer's Guide

This is a quick guide to OAuth2 support in GitHub for developers. This is still experimental and could change at any moment. This Gist will serve as a living document until it becomes finalized at Develop.GitHub.com.

OAuth2 is a protocol that lets external apps request authorization to private details in your GitHub account without getting your password. All developers need to register their application before getting started.

Web Application Flow

  • Redirect to this link to request GitHub access:
@hugowetterberg
hugowetterberg / brew_mamp.markdown
Created June 21, 2010 07:16
How to get a working XAMP stack with brew
build:
@echo "Combining files ..."
@cat \
js/dep/jquery.easing.js \
js/dep/jquery.jsonp.js \
js/dep/json2.js \
js/dep/toolbox.expose.js \
js/lib/jquery.transloadit2.js > build/jquery.transloadit2.js
@echo "Compiling with Closure REST API ..."
@curl \

Apps

<?php
class ServicesContext implements ArrayAccess {
protected $handlers;
protected $namespaces;
private $values = array();
function __construct($handlers = array(), $namespaces = array()) {
$this->handlers = $handlers;
$this->namespaces = $namespaces;
<?php
/**
* Make MySQL correctly sort nodes on swedish sites
*/
function hook_install() {
db_query("ALTER TABLE {node} MODIFY
title VARCHAR(255)
CHARACTER SET utf8
COLLATE utf8_swedish_ci");
}
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title></title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<style>
ul {
overflow: hidden;
width: 150px;
height: 70px;

Use the post-receive in a repo on eg. your testing or production server. Create a git-repo on the server for the code you want to run there and add it as a remote to your local checkout of your project repo. Whenever you want to deploy you push to the git repo on the server and with the below script as the post-receive hook on the project the server will automatically update with the new code.

Originally described in a now probably slightly outdated blog post: http://blogs.goodold.se/tech/2009/06/26/git-workflow-going-live/

To use this hook the git repository on the server should have another branch than its master branch checked out. The git repo on the server can be an entirely new one and doesn't have to be a checkout of your project repo. Creating an entirely new repo involves some fiddling with temporary commits and force pushing though - nothing complicated, but perhaps not something that everyone is used to be doing.

/*
* matchMedia() polyfill - test whether a CSS media type or media query applies
* primary author: Scott Jehl
* Copyright (c) 2010 Filament Group, Inc
* MIT license
* adapted by Paul Irish to use the matchMedia API
* http://dev.w3.org/csswg/cssom-view/#dom-window-matchmedia
* which webkit now supports: http://trac.webkit.org/changeset/72552
*
* Doesn't implement media.type as there's no way for crossbrowser property
@wilmoore
wilmoore / sass_and_less_compared.markdown
Created February 10, 2011 06:17 — forked from chriseppstein/sass_and_less_compared.markdown
Sass/Less Comparison (updated 2011-02-09) -- thanks to chriseppstein for starting this

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For less, I'm using the ruby version because this is what they suggest on the website. The javascript version may be different.

Variables