Skip to content

Instantly share code, notes, and snippets.

View ghostbar's full-sized avatar

Jose-Luis Rivas ghostbar

View GitHub Profile
@ghostbar
ghostbar / app.coffee
Created February 12, 2012 01:49
How to read session from Redis with Express + Socket.IO in CoffeeScript
class App
express = require 'express'
redis = require 'redis'
RedisStore = require('connect-redis')(express)
sessionStore = new RedisStore()
# These will be used only on ioController()
fs = require 'fs'
parseCookie = require('connect').utils.parseCookie
@ghostbar
ghostbar / script.js
Created September 13, 2011 05:15
Script for swapping img's src attr synced with tabs from jQueryUI
/* @author Jose Luis Rivas <[email protected]>
*
* @desc swaping full-background pages with jQuery UI's Tabs plugin events.
*/
$(document).ready(function() {
$( "#slides" ).bind( "tabsshow", function(event, ui) {
var tabattr = $('.ui-state-active').find('a').attr('href');
<!doctype html>
<head>
<link rel="stylesheet" href="style.css">
</head>
<body>
<img id="bg" src="/img/bg.jpg">
<p>Content</p>
</body>
</html>
# Most GPRS phones don't reply to LCP echo's
lcp-echo-failure 0
lcp-echo-interval 0
# Keep pppd attached to the terminal:
# Comment this to get daemon mode pppd
nodetach
# Debug info from pppd:
# Comment this off, if you don't need more info
@ghostbar
ghostbar / git-empty-branch
Created October 20, 2009 01:46
creates a git empty branch
#!/bin/sh
# creating a git empty branch
# it takes as arg the name for the new branch
git-symbolic-ref HEAD refs/heads/$1
rm .git/index
git clean -fdx
git commit --allow-empty -m "Initial empty branch commit"
@ghostbar
ghostbar / deb-pooling-experimental
Created October 17, 2009 00:49
reprepro pooling system
#!/bin/sh
DCRET=/home/ghostbar/incoming-experimental
DCROT=/srv/reprepro.deb.rivco.info
for i in $( find $DCRET | grep ".changes" ); do
reprepro -Vb $DCROT include experimental $i
mkdir -p /home/ghostbar/debian.rivco.info/$( grep "Source: " $i | sed 's/Source: //' )/$( grep "Version: " $i | sed 1's/Version: //' | grep --max-count=1 - ).exp
for j in $( dcmd $i ); do
mv $j /home/ghostbar/debian.rivco.info/$( grep "Source: " $i | sed 's/Source: //' )/$( grep "Version: " $i | sed 1's/Version: //' | grep --max-count=1 - ).exp/