This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'mechanize' | |
agent = Mechanize.new | |
agent.get("http://www.livingelectro.com/index.php?genre=Trance") | |
links = agent.page.search('a') | |
#puts links | |
hrefs = links.map { |m| m['href'] }.select { |u| u =~ /\-mp3/ } | |
FileUtils.mkdir_p('livingelectro') | |
hrefs.each { |mp3| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(int argc, char *argv[:>) <% | |
if( argc > 1 ) { | |
printf("you passed %d argument%s to %s.\n", | |
argc - 1, ( argc == 2 ) ? "" : "s", argv<:0]); | |
%> else { | |
printf("you passed no arguments to %s.\n", argv[0:>); | |
%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
git_bundles = [ | |
"git://github.com/msanders/snipmate.vim.git", | |
"git://github.com/scrooloose/nerdtree.git", | |
"git://github.com/timcharper/textile.vim.git", | |
"git://github.com/tpope/vim-git.git", | |
"git://github.com/tpope/vim-markdown.git", | |
"git://github.com/tpope/vim-rails.git", | |
"git://github.com/tpope/vim-repeat.git", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filetype off | |
call pathogen#helptags() | |
call pathogen#runtime_append_all_bundles() | |
syntax on | |
filetype plugin indent on | |
set tabstop=2 | |
set smarttab | |
set shiftwidth=2 | |
set autoindent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CC = g++ | |
CFLAGS = -Wall -O2 | |
LDFLAGS = -lpcap | |
OBJFILES := $(patsubst %.cc,%.o,$(wildcard *.cc)) | |
PROG=pcapr | |
COMPILE = $(CC) $(CFLAGS) -c | |
all: $(PROG) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "tweetstream" | |
TweetStream.configure do |config| | |
config.username = '<user>' | |
config.password = '<pw>' | |
config.auth_method = :basic | |
config.parser = :json_gem | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cyclone.web | |
import functools | |
def requiredrole(role): | |
"""@requiredrole(role_name) | |
Example: | |
class Secret(BaseHandler): | |
@requiredrole("admin") | |
@cyclone.web.authenticated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from storm.locals import * | |
from twisted.internet import task,defer,reactor,threads | |
class User(object): | |
__storm_table__ = "person" | |
id = Int(primary=True) | |
name = Unicode() | |
class TwistedStore(Store): | |
def find(*args,**kwargs): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'formula' | |
class Freeswitch < Formula | |
url 'http://files.freeswitch.org/freeswitch-snapshot.tar.gz' | |
homepage '' | |
md5 'bb0aa3a04479f06caa8815530ca22d05' | |
version '1.0.8.alpha' | |
depends_on 'cmake' | |
depends_on 'jpeg' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static function blob($proj, $path) { | |
$gitBinary = System::get('git_binary'); | |
$cmd = sprintf("GIT_DIR=%s%s %s show HEAD:%s 2>&1", self::$repos[$proj], | |
System::get('repo_suffix'), | |
$gitBinary, | |
escapeshellarg($path)); | |
$content = shell_exec($cmd); | |
return array( | |
'content' => $content, | |
'ext' => 'something' |
OlderNewer