Skip to content

Instantly share code, notes, and snippets.

View common-nighthawk's full-sized avatar

Daniel Deutsch common-nighthawk

View GitHub Profile
@common-nighthawk
common-nighthawk / 0.2.1-boggle_class_from_methods.rb
Last active August 29, 2015 13:56 — forked from dbc-challenges/0.2.1-boggle_class_from_methods.rb
phase 0 unit 2 week 1boggle class challenge
class BoggleBoard
attr_reader :board
def initialize(board)
@board = board
end
def create_word(*coords)
coords.map { |coord| @board[coord.first][coord.last]}.join("")
end
@common-nighthawk
common-nighthawk / jquery_example.html
Created March 31, 2014 18:24 — forked from dbc-challenges/jquery_example.html
Intro to jQuery for Phase 0
<!DOCTYPE html>
<html>
<head>
<title>DOM manipulation with jQuery</title>
<!-- Add a link to jQuery CDN here script here -->
<script type="text/javascript" src="jquery_example.js"></script>
</head>
<body>
@common-nighthawk
common-nighthawk / jquery_example.html
Last active August 29, 2015 13:57 — forked from dbc-challenges/jquery_example.html
Intro to jQuery for Phase 0
<!DOCTYPE html>
<html>
<head>
<title>DOM manipulation with jQuery</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="jquery_example.js"></script>
</head>
<body>
<h1> Hello. Welcome to the jQuery DOM Manipulation Challenge! </h1>
<div class="mascot">
@common-nighthawk
common-nighthawk / texas.md
Last active August 29, 2015 14:14
San Antonio and Austin

Austin

Restaurants

  • comprehensive list available here
  • Brunch/Daytime Options:
    • La BBQ - Best BBQ ever. There's usually about an hour wait but they have a keg of free beer and the bbq is like none other. I'd go here over franklins honestly!
    • Gordoughs... Everything comes on a donut. It sounds terrible but it is insanely delicious.
    • Bangers!! They have 1 million different types of sausages and beer on tap. It's on rainey street and is a great place for a big group!
    • 24 Diner on Lamar and Sixth. Great for yummy comfort food. Anytime of the day.
    • Torchy's Tacos, El Tacorido or Taco Deli for breakfast tacos
  • Takoba has a bad ass mexican food brunch with $1.5 mimosas or $7 mimosa carafe. The best days start here.
@common-nighthawk
common-nighthawk / gist:fb4b34a81fc3746419af
Last active November 7, 2015 14:19
python wptrunner error
Traceback (most recent call last):
File "/Users/Daniel/Library/Python/2.7/lib/python/site-packages/wptrunner-1.14-py2.7.egg/wptrunner/wptrunner.py", line 219, in main
kwargs = wptcommandline.parse_args()
File "/Users/Daniel/Library/Python/2.7/lib/python/site-packages/wptrunner-1.14-py2.7.egg/wptrunner/wptcommandline.py", line 380, in parse_args
parser = create_parser()
File "/Users/Daniel/Library/Python/2.7/lib/python/site-packages/wptrunner-1.14-py2.7.egg/wptrunner/wptcommandline.py", line 43, in create_parser
config_data = config.load()
File "/Users/Daniel/Library/Python/2.7/lib/python/site-packages/wptrunner-1.14-py2.7.egg/wptrunner/config.py", line 64, in load
return read(path(sys.argv))
File "/Users/Daniel/Library/Python/2.7/lib/python/site-packages/wptrunner-1.14-py2.7.egg/wptrunner/config.py", line 29, in read
def create_list (items)
items_arr = items.split(" ")
grocery_list = {}
items_arr.each do |items|
grocery_list[items] = 1
end
return grocery_list
end
@common-nighthawk
common-nighthawk / ruby.txt
Created October 10, 2016 14:15
building ruby from source on Ubuntu Server 14.04 LTS (HVM), SSD Volume Type
1. sudo apt-get update // downloads the package lists from the repositories and updates them
2. sudo apt-get upgrade // fetches new versions of packages existing on the machine
3. sudo apt-get install build-essential // the tool to build ruby from C is in here
4. sudo apt-get install openssl zlib1g zlib1g-dev libssl-dev // without these, gem installs will not work
5. download ruby with wget and cd into it
6. ./configure
7. make
8. sudo make install
'use strict';
exports.handler = (event, context, callback) => {
const execSync = require('child_process').execSync;
var http = require('http');
var ip = event["headers"]["X-Forwarded-For"].split(",")[0];
http.get({ host: 'freegeoip.net', path: '/json/' + ip }, function(res) {
res.on("data", function(chunk) {
var city = JSON.parse(chunk.toString())["city"].toLowerCase();
//get the machine ready
sudo apt-get update
sudo apt-get upgrade
//set up go
sudo apt-get install golang-go
mkdir ~/go
mkdir ~/go/src
export GOPATH=~/go/
@common-nighthawk
common-nighthawk / tmux-script.sh
Last active March 18, 2017 19:37
tmux script to launch Figure project
#!/bin/sh
tmux has-session -t figure
if [ $? != 0 ]
then
tmux new-session -s figure -n editor -d
tmux send-keys -t figure 'cd ~/Documents/go-workspace/src/figure/' C-m
tmux send-keys -t figure 'vim' C-m
tmux split-window -h -p 40 -t figure
tmux send-keys -t figure:0.1 'cd ~/Documents/go-workspace/src/figure/' C-m