Skip to content

Instantly share code, notes, and snippets.

View awhit012's full-sized avatar

Alex White awhit012

View GitHub Profile
# finished
PUZZLES = [
"105802000090076405200400819019007306762083090000061050007600030430020501600308900",
"005030081902850060600004050007402830349760005008300490150087002090000600026049503",
"105802000090076405200400819019007306762083090000061050007600030430020501600308900",
"005030081902850060600004050007402830349760005008300490150087002090000600026049503",
"005030081902850060600004050007402830349760005008300490150087002090000600026049503",
"290500007700000400004738012902003064800050070500067200309004005000080700087005109",
"080020000040500320020309046600090004000640501134050700360004002407230600000700450",
"608730000200000460000064820080005701900618004031000080860200039050000100100456200",
@awhit012
awhit012 / rovarspraket.rb
Created May 4, 2015 01:23
rovarspraket converter
def rovarspraket(string)
vowels = ['a','e','i','o','u' 'y', 'Å', 'Ä', 'Ö']
vowels.each{|vowel| vowel.downcase!}
answer = ""
string.each_char do |char|
if char =~ /[[:alpha:]]/
unless vowels.include?(char) || vowels.include?(char.downcase)
answer += char + 'o' + char.downcase
else
answer += char
@awhit012
awhit012 / rps.rb
Created May 5, 2015 00:25
Rock Paper Scissors in Ruby
MESSAGES = [
"Choose your weapon",
"Computer has chosen ",
"TIE!",
"Computer Wins",
"You Win!"
]
def run
puts MESSAGES[0]
@awhit012
awhit012 / gist:089a54b09a53ee389827
Created July 16, 2015 01:31
spirit_of_mckenna.py
import praw, time, csv, random, itertools, requests
BOT = 'spirit_of_mckenna'
PASSWORD = "" #not actual password
KEYWORD = "mckenna"
SLEEP_MESSAGE = "Sleeping for 12 hours..."
BY_LINE = " -Terence McKenna"
USER_AGENT = "When people reference McKenna, I provide a quote of his, /u/spirit_of_mckenna"
SUBREDDITS = [ 'test',
'psychonaut',
@awhit012
awhit012 / camel.js
Created August 13, 2015 04:18
Console game for OO JavaScript practice
var prompt = require('prompt');
prompt.start();
WELCOME = [
"Welcome to Camel Run!" ,
"You have stolen a camel (you egg!) to make your way across the great Mobi desert." ,
"The townspeople want their camel back and are chasing you down! Survive your" ,
"desert trek and outrun the blockos." ,
"Only drink when necessary. Always use E. to display your status!" ,
"Do not let your thirst go above 6 and your camel's tiredness above 8."
{
"school": "General Assembly",
city: "San Francisco",
course: "Web Development Immersive",
course_id: "WDI22",
classrootm: "1",
students: [{
id: 0,
last_name: "Aramayo",
first_name: "Angelo",
@awhit012
awhit012 / quick_refactor.js
Created December 22, 2015 00:12
a quick refactor of a students code
function Game(){
this.prophesy = document.getElementById("prophesy");
this.current_user;
}
Game.prototype.smash() {
var cookie = document.getElementById("cookie");
if (cookie.style.display === '') {
cookie.style.display = 'none';
// class notes: https://github.com/DelmerGA/intermediate_talk
// javascript in one pic: https://github.com/coodict/javascript-in-one-pic
// Our code to do something a random number of seconds later
var fullName = function(args){
return args.firstName + " " + args.lastName;
};
var joke = function(args){
# This is a script to delete every comment and post on a reddit account.
# You may have to run it several times, depending on how many comments and posts you have on your user, due to
# the batching process of reddit's API.
import praw, csv, pprint
USERNAME = ""
PASSWORD = ""
class Bot:
@awhit012
awhit012 / heroku-deploy.md
Created June 9, 2016 18:57
Heroku Deploy

Heroku Deploy

  1. Have a Sinatra app that works on localhost that is committed, up to date and on the master branch.
  2. heroku login and enter credentials
  3. heroku create *YOUR_APP_NAME*
  4. git push heroku master
  5. heroku run rake db:create
  6. heroku run rake db:migrate
  7. heroku run rake db:seed
  8. heroku open