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
/* | |
Copyright (c) 2009 Abdel A Saleh - asaleh at the-experimenters (dot) com / http://twitter.com/abdels | |
This work is licensed under the Creative Commons BSD license, http://creativecommons.org/licenses/BSD. | |
Please include the NewSoftSerial library found here: http://arduiniana.org/libraries/newsoftserial | |
*/ | |
#include <NewSoftSerial.h> | |
#define deviceResetPin 4 |
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
# encoding: utf-8 | |
require "rubygems" | |
require "rest_client" | |
require "json" | |
TWEET_TEXT_FONTS = %w(rozzo big fuzzy bulbhead speed nancyj-fancy gothic cosmike straight smisome1 stampatello tinker-toy kban lcd wavy) | |
tweets = [] |
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
MVIM Cheat Sheet: | |
* auto complete | |
ctrl+n | |
or | |
ctrl+p | |
* Running Rake for test | |
:Rake |
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
pid /opt/nginx/logs/nginx.pid; | |
# Run as the nginx user | |
user nginx nginx; | |
worker_processes 2; | |
error_log /opt/nginx/logs/error.log notice; | |
events { | |
worker_connections 1024; | |
use epoll; |
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
server { | |
access_log /opt/nginx/logs/test_server.access.log main buffer=32k; | |
error_log /opt/nginx/logs/test_server.error.log info; | |
expires 6h; | |
listen 2300 default rcvbuf=64k backlog=128; | |
root /opt/apps/test_server/current/public; | |
server_name test_server.com www.test_server.com; | |
passenger_enabled on; | |
} |
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
set daemon 60 | |
set logfile syslog facility log_daemon | |
set mailserver localhost | |
set mail-format { from: [email protected] } | |
set alert root@localhost | |
set httpd port 2812 and | |
allow admin:test | |
include /etc/monit.d/* | |
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
def index_in_batches(klass, criteria={}) | |
offset = 0 | |
while true do | |
list = klass.all(criteria.merge(:limit => 30, :offset => offset)) | |
break if list.empty? | |
Sunspot.index(list) | |
Sunspot.commit | |
offset += 30 | |
end | |
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
# encoding: utf-8 | |
class FlickrService | |
def initialize | |
@api_key = YAML.load_file(File.join(Dir.getwd, "config/flickr_service.yml"))["api_key"] | |
end | |
def photo_info_for(flickr_image_uri) | |
begin | |
result = {} |
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 | |
require 'rubygems' | |
require 'rdf' | |
require 'rdf/rdfxml' | |
PROGRAMMES_URL = 'http://www.bbc.co.uk/programmes' | |
PO = RDF::Vocabulary.new("http://purl.org/ontology/po/") | |
brand_pid = 'b0081dq5' |
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
# Use Fink (if available) | |
test -r /sw/bin/init.sh && . /sw/bin/init.sh | |
# In Mac OS X, what network location is set? | |
if [ -f "/usr/sbin/scselect" ]; then | |
export LOCATION=$(/usr/sbin/scselect 2>&1 | perl -ne 'if (m/^\s+\*\s+(\S+)\s+\((.+)\)$/) { print "$2\n"; }') | |
echo "Network Location: $LOCATION" | |
fi |
OlderNewer