Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
# your choice
pid_path = "/var/run/beanstalkd"
beanstalkd = "/usr/bin/beanstalkd"
beanstalkd_opts = "-d -p 9000"
if ["start", "stop"].include? ARGV[0]
case ARGV[0]
when "start"
@esmooov
esmooov / test.php
Created September 10, 2010 19:53 — forked from ashaw/.gitignore
<style>
.retweet{
-moz-background-clip:border;
-moz-background-inline-policy:continuous;
-moz-background-origin:padding;
background-attachment:scroll;
background-color:#d6d6d6;
background-image:none;
background-position:0 0;
background-repeat:repeat;
<div style="font-family:Helvetica,arial,sans-serif;">
<div style="width:600px;padding-top:10px;padding-bottom:10px;">
<div style="font-weight:bold;font-size:16px;padding:0;padding-left:25px;padding-bottom:8px;margin:0;"><span style="color:#990000;">TPM</span> DayBreaker</span> <span style="font-family:Georgia,Times,serif;font-size:12px;">September 13, 2010</div>
<div style="font-family:Georgia,Times,serif;font-size:12px;padding:0;padding-left:25px;margin:0;">
Good morning,<br />
Welcome to TPM's DayBreaker for Monday, September 13. Here's what we're tracking today:
</div>
</div>
require 'rubygems'
require 'faker'
open('fakeclass.txt',"w") do |f|
250.times do
f.puts Faker::Company.name + " seeks " + ["youth","hard worker","prodigy","student","fun-loving adult","gifted employee","individual","associate","employee","forward-thinker"].rand + " to "+Faker::Company.bs+"."
f.puts ["Call us at ","Give us a ring at ","Dial us at "].rand + Faker::PhoneNumber.phone_number
f.puts Faker::Address.street_address(true) +", "+ Faker::Address.city + ", "+Faker::Address.us_state
f.puts ["Email us at ","Drop us an email- ","Contact us on the world wide web at "].rand + Faker::Internet.email
$('.toolbarTab').click(function(){
var type;
$(this).addClass("selected");
$('.toolbarTab').not(this).removeClass("selected");
type = $(this).children('h4').html();
});
////////
When there's a state up congro.unmagnified === false and congro.mag_state !== undefined it === some state
<style>
.mw_retweet{
-moz-background-clip:border;
-moz-background-inline-policy:continuous;
-moz-background-origin:padding;
background-attachment:scroll;
background-color:#e7e7e7;
background-image:none;
background-position:0 0;
background-repeat:repeat;
var hide = {
the: function(el){
this.and_the = function(sel){
$(el).hide();
$(sel).hide();
}
return this;
}
};
hide.the("overlay").and_the("gatewayCreative");
function(){
var $$ = function(query){
!!(query && query.nodeType == 1) ?
this.dom = query
:
this.dom = document.getElementById(query);
};
$$.prototype.remove = function(){
this.dom.parentNode.removeChild(this.dom);
@esmooov
esmooov / p74.hs
Created May 29, 2011 14:31
Project Euler 74
{- Runs in 14 seconds -}
import Data.List
import Data.Array
import Data.Digits
{- Is this the fastest factorial? Nope. Is it a fun, recursive and dynamic? Yup. -}
fac :: Integer -> Integer
fac n = facs !! (fromIntegral n) where

Format layout

An rdb file begins with "REDIS0003" encoded as a bytestring. [9 bytes]


For each database in the dump

  • The first byte is the SELECT_DB opcode (0xfe) [1 byte]
  • The second byte is the length-encode database number (See below) [1-4 byte(s)]