Skip to content

Instantly share code, notes, and snippets.

View jrhorn424's full-sized avatar
🌟
Always be dreaming

Jeffrey Horn jrhorn424

🌟
Always be dreaming
View GitHub Profile
body {
margin: 40px auto;
max-width: 650px;
line-height: 1.6;
font-size: 18px;
color: #444;
padding: 0 10px
}
h1,
@jrhorn424
jrhorn424 / attempting_to_curl.md
Last active November 10, 2015 19:26 — forked from jcmeyer10/gist:ccddcc239676d58094dd
Commands and Error Messages When Trying to POST to my table through CURL

I am trying to run this. I am able to post to the table through Rails C, so I have access from there.

curl --request POST --header "Authorization: Token token="d168c8333a2b72bf7ad7bfe4bb9c669d" --header "Content-Type: application/json" -d '{
  "beer": {
    "name":"UFO"
    "brewery":"Harpoon"
    "style":"Hefe"
    "location_id":"11"
 }
//Verison 0
'use strict';
var counterFactory = function counterFactory() {
return function() {};
};
var firstCounter = counterFactory();
// firstCounter contains a reference to
// a new instance of the minimal function
@jrhorn424
jrhorn424 / age.js
Created October 6, 2015 15:02 — forked from gaand/age.js
var age = function age() {
var dob = new Date(this.dob);
var today = new Date();
var thisYear = today.getFullYear();
if (dob.getMonth() > today.getMonth() ||
dob.getMonth() === today.getMonth() &&
dob.getDate() >= today.getDate()) {
thisYear -= 1;
}

vimdiff cheat sheet

##git mergetool

In the middle file (future merged file), you can navigate between conflicts with ]c and [c.

Choose which version you want to keep with :diffget //2 or :diffget //3 (the //2 and //3 are unique identifiers for the target/master copy and the merge/branch copy file names).

:diffupdate (to remove leftover spacing issues)

:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)

@jrhorn424
jrhorn424 / nand
Created April 24, 2015 01:29
NAND is the root of all elementary logic.
NAND
====
| x | y | NAND |
| - | - | ---- |
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
#!/usr/bin/env ruby
require 'rubygems'
require 'twitter'
require 'json'
require 'faraday'
# things you must configure
PATH_TO_DROPBOX = "/Users/your_name/Dropbox/backup/tweets/" # you need to create this folder
TWITTER_USER = "your_twitter_username"

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

// Inspired by http://css-tricks.com/vertically-center-multi-lined-text/
@mixin vertical-center-children($height: auto, $children: ':first-child') {
display: table;
height: $height;
#{$children} {
display: table-cell;
vertical-align: middle;
}
}
@jrhorn424
jrhorn424 / _project_using_karma_jasmine_jquery.txt
Last active August 29, 2015 14:16
Getting jasmine-jquery to work with karma
[project root]
├── app/
│   ├── js/
│   │   └── app.js
│   └── index.html
├── test/
│   ├── spec/
│   │   ├── fixtures/
│   │   │   ├── todo.html
│   │   ├── helper.js