Skip to content

Instantly share code, notes, and snippets.

View Sitebase's full-sized avatar
🤘

Wim Mostmans Sitebase

🤘
View GitHub Profile
@shubik
shubik / gist:10955038
Created April 17, 2014 05:28
requirejs onBuildWrite to remove jsx!
onBuildWrite: function (moduleName, path, contents) {
return contents.replace(/jsx!/g, '');
}
@s-panferov
s-panferov / class_manager.ts
Last active August 29, 2015 14:10
BEM ClassManager
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 October 13, 2011 20:43
Puppet EC2 Security Group ENC
#!/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 April 25, 2012 04:28
node.js web beacon (web bug) serving
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 04:06
Precompile Heroku PHP Binaries
#!/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 October 7, 2015 10:47
Apache 2.2.24 & PHP 5.4.14 / Heroku pre-compile script
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 July 23, 2012 16:39
JS: Read, write and erase cookies with JavaScript.
@stephen
stephen / eventTester.js
Created May 11, 2014 19:31
node-sonos eventing framework
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);
});
#!/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
@outmost
outmost / node_beacon.js
Last active December 17, 2015 01:58
Node JS beacon to capture performance metrics from Boomerang.
// Assumptions
// Boomerang makes beacon call to port :8080
// StatsD is running on same server (localhost)
// The following NodeJS modules are installed:
// https://github.com/tobie/ua-parser
// https://github.com/bluesmoon/node-geoip
// Boomerang is configured to send custom parameters for "domain", "page_type", "user_status", "ip" and "user_agent".
// http://lognormal.github.io/boomerang/doc/howtos/howto-5.html