Skip to content

Instantly share code, notes, and snippets.

Ben Bailey benfb

Block or report user

Report or block benfb

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Rnotes.r
# basic data setup
d <- read.csv('/Users/ben/Documents/hampshire/S2015/collapse_phenomena/resistance.csv', header = TRUE, sep = ",")
d <- read.table('/Users/ben/Downloads/adolescenthealth/DS0001/21600-0001-Data.tsv', sep='\t', header=TRUE)
data <- da34933.0001 # store the dataframe in an easily accessible variable
# Convert to actual numerical variables
lbls <- sort(levels(data$PSILCY))
benfb / Test1.ipynb
Created Apr 20, 2015
test notebook
View Test1.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
benfb /
Last active Aug 29, 2015

On Nginx

adduser ben
gpasswd -a ben sudo
su - ben
mkdir .ssh
chmod 700 .ssh
vim .ssh/authorized_keys # add person key to file
vim /etc/ssh/sshd_config: PermitRootLogin no
sudo apt-get update
benfb / stonednerdkitty
Created Apr 3, 2011
The kitty says 'still alive.'
View stonednerdkitty
Tonight I decided to set something interesting to happen every time I open the Terminal.
I decided to use cowsay (
and fortune ( to have a "cow" (kitten in my case)
give out random quotes from Portal, the Hitchhiker's Guide to the Galaxy and Monty Python and the Holy Grail.
I was successful, and decided to share my method.
First, you should install both programs:
brew install fortune
brew install cowsay
benfb / restaurbot.rb
Created Aug 5, 2011
A simple restaurant robot
View restaurbot.rb
# Restaurbot
$done = false
orders = [
'pizza', 'macaroni'
puts 'Hello. What is your name?'
$name = gets.chomp.capitalize
open -A /Applications/iA\ $1
benfb /
Last active Oct 10, 2015
i/o and variables
// name:
// purpose: determine minimum age of a possible date
import java.util.Scanner; // imports the "Scanner" library, which allows the program to set up a new Scanner object
public class BBaileyDateable
// method main(): program starting point
public static void main( String[] args )
import java.util.*;
import java.awt.*;
* Class that represents a turtle which is similar to a Logo turtle.
* This class inherts from SimpleTurtle and is for students
* to add methods to.
* Copyright Georgia Institute of Technology 2004
public class TurtleRunner
public static void main(String args[])
//create a world for your turtles
World turtleWorld = new World(600,800); //creates the turtle canvas
//create a picture
Picture turtle = new Picture("images.jpg"); //lets java know where the picture is
// name:
// purpose: demonstrate further method prowess
public class BBaileyInvoke
// method piggyBank(): returns what the change is worth in cents
public static int piggyBank(int pennies, int nickles, int dimes, int quarters, int halfDollars) //creates the piggyBank method, which takes the arguments pennies, nickles, dimes, quarters, and halfDollars
double money = (pennies *.01) + (nickles*.05) + (dimes*.1) + (quarters*.25) + (halfDollars*.5); //calculates the amount of money needed
You can’t perform that action at this time.