Skip to content

Instantly share code, notes, and snippets.

@sumitasok
sumitasok / interface-funcprog-oop.go
Last active August 29, 2015 14:05
A Display of interface and Functional Programming playing hand in hand with OOP - with Golang
package reqresp
type ReqResp interface {
HashableString() string
IgnoreList() map[string]string
}
type Response struct {
Type Type
Details DataTypes
@marcuswestin
marcuswestin / Selenium-SauceLabs-NodeJS.js
Created March 21, 2011 21:29
Get started using Selenium with SauceLabs and NodeJS
require('soda').createSauceClient({ 'username': 'username-string', 'access-key': 'access-key-string',
'url': 'http://example.saucelabs.com/', 'max-duration': 300,
'os': 'Windows 2003', 'browser': 'firefox', 'browser-version': '3.6',
'name': 'This is an example test' }).chain.session()
.open('/')
.getTitle(function(title){
require('assert').ok(~title.indexOf('Cross browser testing with Selenium - Sauce Labs'), 'Title did not include the query');
})
.testComplete()
.end(function(err){
@joelg
joelg / gist:932496
Created April 20, 2011 19:40
Code for the Buffer Button in Wordpress
<a href="http://bufferapp.com/add" class="buffer-add-button" data-text="<?php the_title(); ?>" data-url="<?php the_permalink(); ?>" data-via="(Your Twitter username, without @)" data-count="horizontal">Buffer</a><script type="text/javascript" src="http://static.bufferapp.com/js/button.js"></script>
@j4mie
j4mie / gunicorn-projectname.conf
Created May 13, 2011 08:07
upstart configuration for gunicorn
description "upstart configuration for gunicorn"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
exec /home/jamie/.virtualenvs/projectname/bin/gunicorn_django -c /home/jamie/code/projectname/gunicorn.py /home/jamie/code/projectname/settings/production.py
@rbscott
rbscott / elasticsearch.conf
Created June 28, 2011 19:46
upstart job for elastic search
# ElasticSearch Service
description "ElasticSearch"
start on (net-device-up
and local-filesystems
and runlevel [2345])
stop on runlevel [016]
@joemiller
joemiller / sensu-handler-input-example.json
Created February 2, 2012 11:33
example json data passed into Sensu handlers via STDIN
{
"client":{
"name":"host01",
"address":"10.2.1.11",
"subscriptions":[
"all",
"env_qa",
"frontend",
"proxy",
"apache"
<svg version="1.1" id="4fd10ef2fd8774ade500001c" xmlns="http://www.w3.org/2000/svg" xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1000px" height="1000px" viewBox="0 0 1000 1000" enable-background="new 0 0 1000 1000" space="preserve" title="Visual.ly Chart " Title="Visual.ly Chart ">
<g id="_x40_starcraft-tournamentwinningsarea" transform="translate(255.55470275878906,7.853499889373779)"><rect class="bgRect" width="253.3192138671875" height="150" x="0" y="0" style="fill: #ffffff; opacity: 0; "></rect><g class="chart_axes"></g><g class="chart_extra"><g class="chart_lines"><rect class="odd" y="0" height="150" x="0" width="1.6776106878621688" style="fill: #336699; fill-opacity: 0.2; "></rect><rect class="odd" y="0" height="150" x="0" width="1.6776106878621688" style="fill: #74a9cf; fill-opacity: 0.7; "></rect></g><g class="chart_lines"><rect class="even" y="0" height="150" x="1.6776106878621688" width="1.6776106878621688" style="fill: #74a9cf; fill-opacity: 0.2; "></rect><rect class="even" y="0" hei
@ChrisLundquist
ChrisLundquist / elasticsearch.coffee
Created November 10, 2012 11:04
elasticsearch plugin for Hubot
# Description:
# Log all the things to ElasticSearch then lets you ask hubot what you missed
#
# Dependencies:
# None
#
# Configuration:
# ELASTICSEARCH_HOSTNAME - E.G. elasticsearch.example.com:9200, where to send the put requests
# ELASTICSEARCH_USERNAME - OPTIONAL basic auth username
# ELASTICSEARCH_PASSWORD - OPTIONAL basic auth password
@jtimberman
jtimberman / rename-node.rb
Created March 2, 2012 07:47 — forked from mpasternacki/rename-node.rb
A knife exec script to change Chef node's name.
#!./bin/knife exec
# A knife exec script to change chef node's name, preserving all the attributes.
#
# Usage: knife exec rename-node.rb old-name new-name
#
# Script retrieves the Node object, changes its 'name' attribute,
# creates new Node object with updated name and rest of attributes
# untouched. Then it deletes old Node and Client objects from
# database, and logs into the server to update it:
@makuk66
makuk66 / acng.conf.diff
Last active December 17, 2015 16:29
apt-cacher-ng patch for oracle java (.bin) and .tgz/.zip
--- acng.conf.orig 2013-05-23 21:20:04.000000000 +0100
+++ acng.conf 2013-05-28 15:02:23.000000000 +0100
@@ -100,6 +100,7 @@
#
#VfilePattern = (^|.*?/)(Index|Packages\.bz2|Packages\.gz|Packages|Release|Release\.gpg|Sources\.bz2|Sources\.gz|Sources|release|index\.db-.*\.gz|Contents-[^/]*\.gz|pkglist[^/]*\.bz2|rclist[^/]*\.bz2|/meta-release[^/]*|Translation[^/]*\.bz2)$
#PfilePattern = .*(\.deb|\.rpm|\.dsc|\.tar\.gz\.gpg|\.tar\.gz|\.diff\.gz|\.diff\.bz2|\.jigdo|\.template|changelog|copyright|\.udeb|\.diff/.*\.gz|vmlinuz|initrd\.gz|(Devel)?ReleaseAnnouncement(\\?.*)?)$
+PfilePattern = .*(\.deb|\.rpm|\.dsc|\.tar\.gz\.gpg|\.tar\.gz|\.tgz|\.zip|\.diff\.gz|\.diff\.bz2|\.jigdo|\.bin(\?AuthParam=.*)?|\.template|changelog|copyright|\.udeb|\.diff/.*\.gz|vmlinuz|initrd\.gz|(Devel)?ReleaseAnnouncement(\\?.*)?)$
# Whitelist for expiration, file types not to be removed even when being
# unreferenced. Default: same as VfilePattern which is a safe bed. When and
# only when the only used mirrors are official repositories