Skip to content

Instantly share code, notes, and snippets.

View thomasv314's full-sized avatar

Thomas Vendetta thomasv314

View GitHub Profile
function BMIPercentile (gender, age, bmi) {
// Mapping from data input file? Will not work this way!!
if (gender == 1) {
// var percentiles_array = boysBMIData;
var percentiles_array = boysBMI;
} else if (gender == 2){
// var percentiles_array = girlsBMIData;
var percentiles_array = girlsBMI;
var Helper = function() {
// Allows for sane event handling with IE
this.addEvent = function(event, element, func) {
if (element.addEventListener) {
element.addEventListener(event, func, false)
} else if (element.attachEvent) {
element.attachEvent("on"+event, func)
} else {
element[event] = func;
}
sudo apt-get update
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison nodejs
sudo apt-get install libmysql-ruby libmysqlclient-dev
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
source ~/.bash_profile
@thomasv314
thomasv314 / gist:7359765
Created November 7, 2013 18:45
SSH Public Key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDTK/8I6abfbm0G3peS+joCBsjhFK7tbYhS2vZEj7262S4LRaQQn/RrjYIsNZw8KWCaCMZtrzGY2CS3VH4Aj7WhBe/pyuFKXP2/SBmrhVomZ1REshEhu6Ifi2uhJlrhCuEBW/nJu7LU8ofVlwjqLhr+1XCSqW+lAJ+8bJ4u7bmBSK77+SJ/5ZaMELiQKRjbWz/Q8Rt5YGCn3+xg8vDAwtAE5jmLrUbMkQRhjY9oTfvOpJ5YYAAek87Fh2dd6NJndkQUL0KQfnTdafSzVUdf2x18z5/2ABqwcw1YBdY2j8qvnzvMwzUARkRYDZ7gfxACJV5GqSfLgh488rVmLc8LgEX9 thomas@Thomass-MacBook-Pro.local
<VirtualHost *:80>
ServerAdmin thomas@thomasvendetta.com
DocumentRoot /srv/www/thomasvendetta.com/public_html
ErrorLog /srv/www/thomasvendetta.com/logs/error.log
CustomLog /srv/www/thomasvendetta.com/logs/access.log combined
<Directory /srv/www/thomasvendetta.com/public_html>
Options FollowSymLinks
AllowOverride None
RewriteEngine on
thomasvendetta:~/ $ curl -v www.landistitle.com [19:11:53]
* About to connect() to www.landistitle.com port 80 (#0)
* Trying 192.241.140.184...
* connected
* Connected to www.landistitle.com (192.241.140.184) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8y zlib/1.2.5
> Host: www.landistitle.com
> Accept: */*
>
curl -v https://developer.apple.com/devcenter/ios/ [17:22:17]
* About to connect() to developer.apple.com port 443 (#0)
* Trying 17.254.2.129...
* Operation timed out
* couldn't connect to host
* Closing connection #0
curl: (7) couldn't connect to host
@thomasv314
thomasv314 / common-mime-types.json
Created April 19, 2013 17:32
List of common #MIME types found on the internet pretty printed in #JSON.
{
".3dm": "x-world/x-3dmf",
".3dmf": "x-world/x-3dmf",
".a": "application/octet-stream",
".aab": "application/x-authorware-bin",
".aam": "application/x-authorware-map",
".aas": "application/x-authorware-seg",
".abc": "text/vnd.abc",
".acgi": "text/html",
".afl": "video/animaflex",
@thomasv314
thomasv314 / united_states_on_rails.rb
Created April 11, 2013 14:19
Ruby array for choosing select options of United States... useful for ruby on rails Source: http://stackoverflow.com/questions/6400010/rails-select-drop-down-for-states #rubyonrails #states
def us_states
[
['Alabama', 'AL'],
['Alaska', 'AK'],
['Arizona', 'AZ'],
['Arkansas', 'AR'],
['California', 'CA'],
['Colorado', 'CO'],
['Connecticut', 'CT'],
['Delaware', 'DE'],
@thomasv314
thomasv314 / block-tor.sh
Created March 21, 2013 16:17
script that adapts mikhailian's implementation of blocking tor nodes... http://mikhailian.livejournal.com/48051.html
#! /bin/bash
# script to block tor nodes
# original credit for this goes to mikhailian: http://mikhailian.livejournal.com/48051.html
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
if [ "${1}" == "" ]; then