Skip to content

Instantly share code, notes, and snippets.

Tekkub tekkub

View GitHub Profile
View gist:1addb5e05d3eb723e6c8d93bd74b5e16
Curly Brace Man, Curly Brace Man
Doing the things a curly brace can
What's he like? It's not important
Curly Brace Man
Is he a block or is he a hash?
When Ruby is run does he generate a data structure?
Or does he generate Ruby instead?
Nobody knows, Curly Brace Man
@tekkub
tekkub / fallen-london-wikilinks.user.js
Last active Oct 17, 2017
Adds links to look up storylets on the fallen london wiki
View fallen-london-wikilinks.user.js
View keymap.cson
'.workspace .editor:not(.mini)':
'alt-down': 'editor:move-line-down'
'alt-up': 'editor:move-line-up'
View sample_payload.json
{
"before": "5aef35982fb2d34e9d9d4502f6ede1072793222d",
"repository": {
"url": "http://github.com/defunkt/github",
"name": "github",
"description": "You're lookin' at it.",
"watchers": 5,
"forks": 2,
"private": 1,
"owner": {
View hook_template.rb
{
:before => before,
:after => after,
:ref => ref,
:commits => [{
:id => commit.id,
:message => commit.message,
:timestamp => commit.committed_date.xmlschema,
:url => commit_url,
:added => array_of_added_paths,
View gist:1675487
var legalDrivingAge = 18;
var canIDrive = function (myAge) {
if (myAge >= legalDrivingAge)
return true;}
else{return false;}
canIDrive (18)
View gist:1675232
var yourName = "";
var gender = "MALE";
var result;
//Line 10 starts an if statement
//Nested in this if statement is an if else statement on lines 11 - 15
//This nested if else statement allows us to check another condition
//We close the first if statement at the start of line 16
if (yourName.length > 0) {
@tekkub
tekkub / itunes_audiobooks.md
Created Dec 23, 2011
Grouping audiobooks in iTunes
View itunes_audiobooks.md

I feel like I should have a blog for things like this, but there's so random and infrequesnt that it doesn't seem worth it.

So, in prep for the upcoming post-thanksgiving road trip I've been loading my phone up with audiobooks. The thing of it is, we like serires books, and they are always such a mess in the main book list. Why can't I group them up like discs in an album? Turns out you can, if you know exactly how to tag them in iTunes.

For the sake of this example I'm going to tag The Hitchhiker's Guide to the Galaxy. It's a radio series of 5 different stories. Tagging is pretty simple once you know what to do.

  • Set the "Album" to the series name, in this case "The Hitchhiker's Guide to the Galaxy"
  • Set the "Name" to the book's name, our first book is "Primary Phase"
  • DO NOT set the track number fields. If you do the book will display as "Part 1 of 5"
  • Use the "Sort name" field to ensure the books sort in the right order within the series. I used "Hitchhiker's Guide to the Galaxy 1" for
@tekkub
tekkub / array_to_hash.rb
Created Dec 9, 2011
Convert a ruby array into a hash
View array_to_hash.rb
# Convert an array into a hash
#
# Example:
# -> [["bear", "rawr"], ["tanuki", "nuts"]].to_hash
# => {"tanuki"=>"nuts", "bear"=>"rawr"}
class Array
def to_hash
Hash[*self.flatten]
end
You can’t perform that action at this time.