Skip to content

Instantly share code, notes, and snippets.

View gdakram's full-sized avatar
😺

Shahrier Akram gdakram

😺
  • Slytrunk
  • Pacifica, CA
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
var YUI_config = {
injected: true,
comboBase: '../scripts/combo?',
root: '/yui/',
// if combine is false
base: '../scripts/public/yui/',
// where to add the scripts
insertBefore: "favicon",
groups: {
@ryanb
ryanb / application.html.erb
Created January 19, 2011 19:31
Example of very simple password authentication.
<!-- layout file -->
<% if current_user %>
Welcome <%= current_user.username %>. Not you? <%= link_to "Log out", logout_path %>
<% else %>
<%= link_to "Sign up", signup_path %> or <%= link_to "log in", login_path %>.
<% end %>
@bkimble
bkimble / gist:1365005
Last active May 2, 2024 01:27
List local memcached keys using Ruby
#!/usr/bin/env ruby
# List all keys stored in memcache.
# Credit to Graham King at http://www.darkcoding.net/software/memcached-list-all-keys/ for the original article on how to get the data from memcache in the first place.
require 'net/telnet'
headings = %w(id expires bytes cache_key)
rows = []
@jacobbubu
jacobbubu / ioslocaleidentifiers.csv
Created February 15, 2012 14:41
iOS Locale Identifiers
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
mr Marathi
bs Bosnian
ee_TG Ewe (Togo)
ms Malay
kam_KE Kamba (Kenya)
mt Maltese
ha Hausa
es_HN Spanish (Honduras)
ml_IN Malayalam (India)
ro_MD Romanian (Moldova)
@x86ed
x86ed / debug message.js
Created March 29, 2012 18:20
debug msg
function Debug(){// prevents console.logs from ending up in the code when debugging, YAY!
var typeLog = typeof(typeLog) != 'undefined' ? typeLog : "log";
//allows for an optional hrd coded caller argument
var caller = typeof(caller) != 'undefined' ? caller : this.caller;
this.debugMode = false;
function enable(value){
this.debugMode = value;
return this.debugMode;
};
function alertThis(massage,typeLog,caller){
@jobliz
jobliz / RedisPythonPubSub1.py
Created May 4, 2012 17:58
A short script exploring Redis pubsub functions in Python
import redis
import threading
class Listener(threading.Thread):
def __init__(self, r, channels):
threading.Thread.__init__(self)
self.redis = r
self.pubsub = self.redis.pubsub()
self.pubsub.subscribe(channels)
@chriskk
chriskk / memcache.rb
Created July 24, 2012 08:55 — forked from bkimble/gist:1365005
Command line tool to list memcache keys and to get the value of a specific key
#!/usr/bin/env ruby
require 'net/telnet'
require 'lib/trollop'
opts = Trollop::options do
banner <<-EOS
Command line tool to list memcache keys and to get the value of a specific key
Usage:
memcache [options]
@bdalziel
bdalziel / gist:7758256
Created December 2, 2013 20:35
Basic LESS compiler commands on slytrunk
// Tail node log
bdalziel@dev02:~$ sudo su
[sudo] password for bdalziel:
root@dev02:/home/bdalziel# tail -f /var/log/node/less.log
.. log ...
// Kill & restart process in background
@staltz
staltz / introrx.md
Last active July 22, 2024 09:31
The introduction to Reactive Programming you've been missing