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
<?xml version='1.0' encoding="UTF-8"?> | |
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'> | |
<!-- | |
Author: | |
Pierre Lindenbaum | |
http://plindenbaum.blogspot.com | |
Usage : |
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/ruby | |
require "rubygems" | |
require "mongo" | |
require "json/pure" | |
require "open-uri" | |
# db config | |
db = Mongo::Connection.new.db('friendfeed') | |
col = db.collection('lifesci') |
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 | |
puts "looking for the gems to upgrade..." | |
gem_info = Struct.new(:name, :version) | |
to_reinstall = [] | |
Dir.glob('/Library/Ruby/Gems/**/*.bundle').map do |path| | |
path =~ /.*1.8\/gems\/(.*)-(.*?)\/.*/ | |
name, version = $1, $2 | |
bundle_info = `file path` | |
to_reinstall << gem_info.new(name, version) unless bundle_info =~ /bundle x86_64/ | |
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 pickle, pprint, time, os | |
import httplib | |
import smtplib | |
def emailAlert(alert,subject='You have an alert'): | |
fromaddr = "[email protected]" | |
toaddrs = "[email protected]" | |
# Add the From: and To: headers at the start! |
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
<!DOCTYPE html> | |
<html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'> | |
<title>Browser Not Supported</title> | |
<meta content='text/html;charset=UTF-8' http-equiv='Content-Type'> | |
<style type='text/css'> | |
body { | |
color:#fff; | |
background:#00f; | |
text-align:center; | |
font-family: 'Courier New', Courier, monospace; |
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
#Colo Server costs | |
set ServerTypes; | |
set InstanceTypes; | |
param CoreDemand; #How many cores do we need for a workload | |
param OurMoney; #The maximum upper-bound of what we're willing to spend | |
param ColoCostPerU; #How much are we paying per U of colocation | |
param Months; # How many months do we know we need this hardware |
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
# Samples for formatting additional Product fields in Spree Admin | |
# SelectField: adds a select box with values 1..20 | |
# WideField: adds a standard text box, but with a specified size | |
# HugeField: adds a text area with a specified number of columns | |
# OptionField: adds an option field | |
# CheckField: adds a checkbox field. | |
Variant.additional_fields += [ | |
{ :name => 'SelectField', | |
:only => [:product], |
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 zsh | |
# 1304046900 TRACKS CHANGES TO PARTS OF SPREE SINCE A GIVEN COMMIT | |
# To be placed at the root of your app. | |
old_commit="29e3d4f707bdb047a6fabc2543247139027b06fb" | |
parts=( | |
core/app/views |
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 'mechanize' | |
require 'logger' | |
require 'date' | |
## Call: | |
## $ ruby export.rb <gmail> <password> | |
# https://www.google.com/history/lookup?hl=en&month=11&day=04&yr=2008&output=rss&num=9999 | |
agent = Mechanize.new do |a| |
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 sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
OlderNewer