This file contains hidden or 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 install Java 7 from Oracle | |
# | |
apt-get update | |
apt-get install python-software-properties | |
add-apt-repository ppa:webupd8team/java | |
apt-get update | |
apt-get install oracle-java7-installer |
This file contains hidden or 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
$(document).ready(function() { | |
$.fn.carousel.defaults = { | |
interval: false, | |
pause: 'hover' | |
}; | |
}); |
This file contains hidden or 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
(function($){ | |
$.support.selectstart = "onselectstart" in document.createElement( "div" ); | |
$.fn.disableSelection = function(){ | |
return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) + | |
".disableSelection", function( event ) { | |
event.preventDefault(); | |
}); | |
}; | |
$.fn.enableSelection = function(){ |
This file contains hidden or 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
source 'https://rubygems.org' | |
gem 'rails', '3.2.9' | |
# Postgres Database | |
gem 'pg' | |
# Twitter API | |
gem 'twitter' |
This file contains hidden or 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
<project name="PrimeNumberAlgos" default="dist" basedir="."> | |
<description> | |
A few prime number algorithms written in Java. | |
</description> | |
<!-- set global properties for this build --> | |
<property name="src" location="src"/> | |
<property name="lib" location="lib"/> | |
<property name="build" location="build"/> | |
<property name="dist" location="dist"/> |
This file contains hidden or 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
# Stolen from here: | |
# http://alexyoung.org/2009/07/03/rapid-rails-boot-up-time/ | |
require 'benchmark' | |
module Kernel | |
alias old_require require | |
def require(path) | |
#unless caller.find { |caller_line| caller_line.match /dependencies\.rb/ } |
This file contains hidden or 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
# TODO: | |
# apt-get install Postgresql | |
# gem install postgresql | |
# | |
# ..more stuff... | |
# | |
# Make sure that your postgres account has | |
# superuser privileges, so "rake postgresql:build_databases" | |
# works properly |
This file contains hidden or 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 | |
@carriers = Carrier.all.sort_by(&:name) | |
@lines = Array.new | |
@carriers.each do |c| | |
c.sw_profiles.each do |p| | |
@lines.push(prepend_hash_keys("carrier", c.attributes).merge(prepend_hash_keys("sw_profile", p.attributes))) | |
end | |
end | |
end |
This file contains hidden or 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 | |
# | |
# A one file test to show count | |
require 'rubygems' | |
require 'dm-core' | |
require 'dm-aggregates' | |
# setup the logger | |
DataMapper::Logger.new(STDOUT, :debug) |
This file contains hidden or 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
# Usage: | |
# ruby latex_server.rb | |
# | |
# Try: <img src="http://localhost:4567/\cos \frac{\pi}{2} = 0"> | |
# Get: A nice looking png of: cos(pi/2) = 0 | |
# | |
# Bug1: Ellipses (...) don't work. Probably the way urls are parsed | |
# b |