Skip to content

Instantly share code, notes, and snippets.

View tekkub's full-sized avatar

Tekkub tekkub

View GitHub Profile
tekkub / share_sheet_swiftui_example.swift
Created April 29, 2021 23:15 — forked from hoyelam/share_sheet_swiftui_example.swift
Share Sheet UIActivityViewController within SwiftUI
View share_sheet_swiftui_example.swift
import SwiftUI
struct ContentView: View {
var body: some View {
VStack {
Text("Hello, world!")
.shareSheet(items: ["Hello world!"])
Text("Hello, world!")
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 / fallen-london-wikilinks.user.js
Last active February 20, 2022 18:40
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": "",
"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 =>,
: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 /
Created December 23, 2011 11:12
Grouping audiobooks in iTunes

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 / array_to_hash.rb
Created December 9, 2011 23:50
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