Skip to content

Instantly share code, notes, and snippets.

Avatar

Daniel Deutsch common-nighthawk

View GitHub Profile
@common-nighthawk
common-nighthawk / tmux-script.sh
Last active Mar 18, 2017
tmux script to launch Figure project
View tmux-script.sh
#!/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
View gist:0a97684919517895664b5720b13f8ed8
//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/
View lambda-post.js
'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();
@common-nighthawk
common-nighthawk / ruby.txt
Created Oct 10, 2016
building ruby from source on Ubuntu Server 14.04 LTS (HVM), SSD Volume Type
View ruby.txt
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
View post_location.sh
#!/usr/bin/env ruby
require 'JSON'
class LocationGetter
attr_reader :endpoint
def initialize(endpoint)
@endpoint = endpoint
end
View gl.rb
def create_list (items)
items_arr = items.split(" ")
grocery_list = {}
items_arr.each do |items|
grocery_list[items] = 1
end
return grocery_list
end
View gist:fb4b34a81fc3746419af
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
@common-nighthawk
common-nighthawk / texas.md
Last active Aug 29, 2015
San Antonio and Austin
View texas.md

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.
View jquery_example.html
<!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">
View jquery_example.html
<!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>