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
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
# Version 2, December 2004 | |
# | |
# Copyright (C) 2004 Sam Hocevar | |
# 14 rue de Plaisance, 75014 Paris, France | |
# Everyone is permitted to copy and distribute verbatim or modified | |
# copies of this license document, and changing it is allowed as long | |
# as the name is changed. | |
# | |
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
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 get_distance | |
venues = [] | |
venues << Venue.new(:lat => 45.572952,:lon => -122.68394,:name => "my house", :vid => 6129841) | |
venues << Venue.new(:lat => 45.569133, :lon => -122.681568, :name => "new seasons", :vid => 42031) | |
venues << Venue.new(:lat => 45.429839, :lon => -122.574021, :name => "24 hour fitness clackamas", :vid => 115506) | |
venues << Venue.new(:vid => 89015, :name => "Fred Meyer, Arbor Lodge", :lat=> 45.577137, :lon => -122.68199) | |
venues << Venue.new(:vid => 39705, :name => "The Green Dragon", :lat => 45.515798, :lon => -122.656703) | |
venues << Venue.new(:vid => 36395, :name => "Oregon Convention Center", :lat => 45.528311, :lon => -122.663204) |
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 icalendar import Calendar, Event | |
import simplejson as json | |
import re | |
import web | |
from mimerender import mimerender | |
import sys | |
import urllib2 | |
event = {} |
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
# First do a fresh install of CentOS 5.7 i386, server configuration (no GUI) | |
# This should be performed as root since it's going to be installing a bunch of stuff | |
# --- Update things to make sure we have the latest patches --- | |
# Add EPEL so we can get reasonably recent packages | |
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm | |
# --- Install all the packages --- # | |
yum -y install python-whisper python-carbon graphite-web python-memcached python-ldap httpd memcached |
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
#sudo sysctl -w net.inet.ip.portrange.first=32768 | |
sudo sysctl -w net.inet.ip.portrange.first=12000 | |
sudo sysctl -w net.inet.tcp.msl=1000 | |
sudo sysctl -w kern.maxfiles=1000000 kern.maxfilesperproc=1000000 |
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 'tweetstream' | |
require 'json' | |
require 'irc-socket' | |
SETTINGS = JSON.load(File.open("settings.json")) | |
@irc = IRCSocket.new(SETTINGS["server"]) | |
@irc.connect | |
@irc.nick SETTINGS["nick"] | |
@irc.user SETTINGS["nick"], 0, "*", "Neuron Bot" | |
@irc.join("#pdxtwitter") |
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
## install mapnik 2.x (trunk) from nightlies | |
# be careful with this because these change nightly | |
# and may require you re-compile apps using mapnik | |
# after you run `apt-get upgrade` post installation of mapnik | |
apt-get install python-software-properties | |
apt-add-repository ppa:mapnik/nightly-trunk | |
sudo apt-get update | |
sudo apt-get install libmapnik2 libmapnik2-dev mapnik2-utils python-mapnik2 | |
## install ruby |
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
// | |
// UIDeviceHardware.h | |
// | |
// Used to determine EXACT version of device software is running on. | |
#import <Foundation/Foundation.h> | |
@interface UIDeviceHardware : NSObject | |
- (NSString *) platform; |
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
# This is Neocities' Rainbows! config file. We are using this in production to run all our web apps. | |
# It works really well for us and has been heavily load tested, so I wanted to share it with the community. | |
# | |
# In my opinion, this is the best way to deploy a ruby web application. Unlike EventMachine based solutions, | |
# it uses real ruby threads, which allows it to take advantage of the internal non-blocking IO pattern | |
# in MRI. | |
# | |
# Contrary to popular belief, MRI doesn't block execution to wait on IO when you are using threads, even | |
# with the GIL. The requests are done concurrently for anything that is based on the IO class. This | |
# includes things like Net::HTTP and even `system commands`. Grep the MRI Ruby source code for |
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 'gollum/frontend/app' | |
require 'digest/sha1' | |
class App < Precious::App | |
User = Struct.new(:name, :email, :password_hash, :can_write) | |
before { authenticate! } | |
before /^\/(edit|create|delete|livepreview|revert)/ do authorize_write! ; end | |
helpers do |
OlderNewer