Skip to content

Instantly share code, notes, and snippets.

View errordeveloper's full-sized avatar

Ilya Dmitrichenko errordeveloper

View GitHub Profile
# Small define to expand a tarball at a location; assumes File[$title]
# definition of tarball and installation of pax:
define baselayout::drop_tarball($dest, $dir_name, $dir_sub='') {
# $dest: cwd in which expansion is done
# $dir_name: name of top level directory created in $dest
# $dir_sub: regexp to -s for pax - not supported for .zip archives
if ($dir_sub) {
@andyedinborough
andyedinborough / jquery.oauth.js
Created June 7, 2011 19:30
Introduces $.oauth() to make using OAuth from jQuery as easy as using $.ajax()
(function (window, document, $, undefined) {
if (!$.Deferred) throw 'jQuery 1.5 is required to use the jQuery.oauth script!';
function require(name, url) {
if (window[name] === undefined)
return $.ajax({ type: 'GET', cache: true, dataType: 'script', url: url });
}
$.oauth = function (options) {
var d = $.Deferred();
@jsnyder
jsnyder / gist:1108326
Created July 26, 2011 23:13
LLVM/Clang now builds for Cortex-M3?
~> cat test.c
int main()
{
int i = 0;
int j = 0;
for( i = 0; i < 100; i++ )
j += i;
return 1;
@yevgenko
yevgenko / .Xdefaults
Created August 24, 2011 02:58
URxvt settings with solarized theme
!-------------------------------------------------------------------------------
! Xft settings
!-------------------------------------------------------------------------------
Xft.dpi: 96
Xft.antialias: false
Xft.rgba: rgb
Xft.hinting: true
Xft.hintstyle: hintslight
## Sample screenrc for rtorrent
## put it in /etc/screen.d/
## and chown for the user you
## who wish to run session
source /etc/screenrc
chdir /home/stuff/dump/
screen -t rtorrent -d . -s .
@utaal
utaal / Makefile
Created September 5, 2011 16:42
webserver using libuv
webserver: webserver.c libuv/uv.a http-parser/http_parser.o
gcc -I libuv/include \
-lrt -lm -lpthread -o \
webserver webserver.c \
libuv/uv.a http-parser/http_parser.o
libuv/uv.a:
$(MAKE) -C libuv
http-parser/http_parser.o:
@shurizzle
shurizzle / gist:1223923
Created September 17, 2011 13:14
Turn a github.com URL into a git.io URL.
#!/usr/bin/env ruby
# Usage: gitio URL [CODE]
#
# Turns a github.com URL
# into a git.io URL
#
# Copies the git.io URL to your clipboard.
require 'net/http'
require 'clipboard'
@technoweenie
technoweenie / Gemfile
Created November 14, 2011 05:46 — forked from rwjblue/Gemfile
Simple CQL to Thrift Comparison in ruby
source :rubygems
gem 'rake'
gem 'forgery'
gem 'cassandra-cql', :path => '../cassandra-cql'
gem 'cassandra', :path => '../cassandra'
gem 'perftools.rb'
gem 'rbtrace'
@lusis
lusis / log4j.xml
Created November 23, 2011 07:11
Ruby logstash cli application - allows searching historical data in ElasticSearch or live tailing from AMQP topic exchange
<!-- the env variables are controlled by Chef and passed in via -D on the java command-line -->
<!-- This is using the appender here: https://github.com/t0xa/gelfj -->
<appender name="graylog2" class="org.graylog2.log.GelfAppender">
<param name="graylogHost" value="${graylog.server}"/>
<param name="originHost" value="${graylog.origin}"/>
<param name="extractStacktrace" value="true"/>
<param name="addExtendedInformation" value="true"/>
<!-- The _web part is because a given app has multiple components -->
<!-- This app might have a _web as well as an _batch component -->
<param name="facility" value="${graylog.facility}_web"/>
@jsnyder
jsnyder / instructions.md
Created March 7, 2012 20:00
Dropbox/Google Docs/LaTeX Instructions

Dropbox + Google Docs + LaTeX

Getting Dropbox

For headless Linux servers you can install a copy of Dropbox in your home folder using the following command:

64-bit: