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
library(ggplot2)
d <- read.csv('/Users/ben/Documents/hampshire/S2015/collapse_phenomena/resistance.csv', header = TRUE, sep = ",")
load("/Users/ben/Downloads/drugs/DS0001/34933-0001-Data.rda")
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
library(prettyR)
lbls <- sort(levels(data$PSILCY))
@benfb
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
benfb / lyricloud_setup.md
Last active Aug 29, 2015
lyricloud_setup
View lyricloud_setup.md

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
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 (http://www.nog.net/~tony/warez/cowsay.shtml)
and fortune (http://en.wikipedia.org/wiki/Fortune_(Unix) 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
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
View iAopen.sh
#!/bin/bash
open -A /Applications/iA\ Writer.app/ $1
@benfb
benfb / BBaileyDateable.java
Last active Oct 10, 2015
i/o and variables
View BBaileyDateable.java
// 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 )
{
View Turtle.java
import java.util.*;
import java.awt.*;
import java.io.*;
/**
* 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
View TurtleRunner.java
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
View BBaileyInvoke.java
// 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.