Skip to content

Instantly share code, notes, and snippets.

Avatar

Wim Mostmans Sitebase

View GitHub Profile
@shubik
shubik / gist:10955038
Created Apr 17, 2014
requirejs onBuildWrite to remove jsx!
View gist:10955038
onBuildWrite: function (moduleName, path, contents) {
return contents.replace(/jsx!/g, '');
}
@s-panferov
s-panferov / class_manager.ts
Last active Aug 29, 2015
BEM ClassManager
View class_manager.ts
module classes {
export interface ClassManager {
mod(...name: string[]): ClassManager;
cmod(condition: boolean, ...name: string[]): ClassManager;
toString(): string;
before(...other: ToString[]): ClassManager;
after(...other: ToString[]): ClassManager;
}
@lordkev
lordkev / ec2_enc.rb
Created Oct 13, 2011
Puppet EC2 Security Group ENC
View ec2_enc.rb
#!/usr/bin/ruby
##
# Classifies a puppet node based on its EC2 security group.
# Requires the AWS gem.
# Also requires a node_groups.yml file which specifies security groups
# and the classes/params that should be applied, in the following
# format (additionally keyed by security group name).
# http://docs.puppetlabs.com/guides/external_nodes.html
#
@ruturajv
ruturajv / beacon.js
Created Apr 25, 2012
node.js web beacon (web bug) serving
View beacon.js
http = require('http');
url = require('url');
http.createServer(function(req, res){
var requestURL = url.parse(req.url, true)['pathname'];
if (requestURL == '/log.gif') {
var imgHex = '47494638396101000100800000dbdfef00000021f90401000000002c00000000010001000002024401003b';
var imgBinary = new Buffer(imgHex, 'hex');
res.writeHead(200, {'Content-Type': 'image/gif' });
@iphoting
iphoting / build-php.sh
Created May 10, 2012
Precompile Heroku PHP Binaries
View build-php.sh
#!/bin/bash
# use AMI ami-04c9306d
# run this script as root.
## EDIT
export S3_BUCKET="heroku-buildpack-php-tyler"
export LIBMCRYPT_VERSION="2.5.8"
export PHP_VERSION="5.4.1"
export APC_VERSION="3.1.10"
export PHPREDIS_VERSION="2.2.1"
@pateketrueke
pateketrueke / install.sh
Last active Oct 7, 2015
Apache 2.2.24 & PHP 5.4.14 / Heroku pre-compile script
View install.sh
mkdir -p /app
# Prepare the filesystem
mkdir -p /tmp/build
cd /tmp/build
# Compiling Apache
curl http://www.us.apache.org/dist/httpd/httpd-2.2.24.tar.gz | tar xzf -
@daveygm
daveygm / cookie.js
Created Jul 23, 2012
JS: Read, write and erase cookies with JavaScript.
View cookie.js
@jellea
jellea / gist:3438926
Created Aug 23, 2012
Webcam snapshot on every git commit
View gist:3438926
#!/bin/bash
#
# This script will make a webcam snapshot every commit. The jpg file will have
# the commit id as the filename.
#
# This script requires imagesnap. Install with: 'brew install imagesnap'
#
# Put this file in the '.git/hooks/' name it 'post-commit' and chmod it by:
# 'chmod +x .git/hooks/post-commit'
#
@stephen
stephen / eventTester.js
Created May 11, 2014
node-sonos eventing framework
View eventTester.js
var Sonos = require('../index').Sonos;
var Listener = require('../lib/events/listener');
var x = new Listener(new Sonos(process.env.SONOS_HOST || '192.168.2.11'));
x.listen('/ZoneGroupTopology/Event', function(err, sid) {
console.log(sid);
});
View changeR53Routes.rb
#!/usr/bin/env ruby
require 'rubygems'
require 'aws-sdk'
AWS.config( :access_key_id => ENV['AWS_ACCESS_KEY_ID'], :secret_access_key => ENV['AWS_SECRET_KEY'] )
bucket = 'route53_backups'
debug = false