Skip to content

Instantly share code, notes, and snippets.

View skyrocknroll's full-sized avatar

Yuvaraj L skyrocknroll

View GitHub Profile
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
@mgedmin
mgedmin / .pythonrc
Created December 30, 2010 20:37
snippets for export PYTHONSTARTUP=~/.pythonrc
# This is the actual file that combines all of the other snippets
# I've been using it for a while, so it's officially Bug Free (TM)
# Python startup script. vim: set ft=python :
# from http://www.norvig.com/python-iaq.html
# also see Tarek Ziade's _Expert_Pythom_Programming_ page 19
import os, sys
# Coloured prompt
if os.getenv('TERM') in ('xterm', 'vt100', 'rxvt', 'Eterm', 'putty'):
@seedifferently
seedifferently / Amazon_SES.py
Created February 1, 2011 19:34
Simple example email wrapper for Boto's SES
"""
Example code for sending emails using boto's SES module. Its main purpose is to
show how easy it is to build multipart text/html emails.
Unfortunately, at this time Amazon's SES doesn't seem to allow you to add
attachments to messages, but if it does in the future it would probably look
like the code that I've commented out below the exception.
The SES module of the Boto package isn't quite finalized yet, but I currently
have this code running using Harry Marr's implementation which is available at:
@michiel
michiel / cors-nginx.conf
Created July 5, 2011 10:41
Wide-open CORS config for nginx
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
@fjunior87
fjunior87 / remove pyc from git
Created July 22, 2011 19:34
Remove .pyc files from a git project
find . -name "*pyc" -exec git rm -f {} \;
@ran488
ran488 / simple-ftp-sample.groovy
Created August 9, 2011 20:03
Simple FTP file retrieval sample (Groovy)
@Grab(group='commons-net', module='commons-net', version='2.0')
import org.apache.commons.net.ftp.FTPClient
println("About to connect....");
new FTPClient().with {
connect "some-server.some-domain.com"
enterLocalPassiveMode()
login "your-username", "your-password"
changeWorkingDirectory "/var/appl/some/remote/dir/"
def incomingFile = new File("some-file-to-retrieve.log")
@mat
mat / INSTALL
Created August 12, 2011 19:43
Turn an Ubuntu 10.04 server into a StatsD/Graphite server
TODO:
- edit /opt/statsd/local.js
- correct the graphite host to localhost
- if desired, put 'debug: true' in there
- make the box accessible via the hostname 'graphite'
- update conf/storage-schemas.conf, see example for these retention rules:
6 hours of 10 second data
1 week of 1 minute data
5 years of 10 minute data
@mleinart
mleinart / graphTemplates.conf
Created September 22, 2011 17:25
Solarized graph template for Graphite
[solarized-dark]
background = #002b36
foreground = #839496
majorLine = #fdf6e3
minorLine = #eee8d5
lineColors = #268bd2,#859900,#dc322f,#d33682,#db4b16,#b58900,#2aa198,#6c71c4
fontName = Sans
fontSize = 10
fontBold = False
fontItalic = False
@cpatni
cpatni / app.rb
Created November 21, 2011 22:39
unique calculation using redis
require 'sinatra'
require 'redis'
require 'json'
require 'date'
class String
def &(str)
result = ''
result.force_encoding("BINARY")
@oodavid
oodavid / README.md
Last active April 6, 2024 18:45 — forked from aronwoost/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/