Skip to content

Instantly share code, notes, and snippets.

View tekkub's full-sized avatar

Tekkub tekkub

View GitHub Profile
@tekkub
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
import SwiftUI
struct ContentView: View {
var body: some View {
VStack {
Text("Hello, world!")
.padding()
.shareSheet(items: ["Hello world!"])
Text("Hello, world!")
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 February 20, 2022 18:40
Adds links to look up storylets on the fallen london wiki
'.workspace .editor:not(.mini)':
'alt-down': 'editor:move-line-down'
'alt-up': 'editor:move-line-up'
{
"before": "5aef35982fb2d34e9d9d4502f6ede1072793222d",
"repository": {
"url": "http://github.com/defunkt/github",
"name": "github",
"description": "You're lookin' at it.",
"watchers": 5,
"forks": 2,
"private": 1,
"owner": {
{
: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,
var legalDrivingAge = 18;
var canIDrive = function (myAge) {
if (myAge >= legalDrivingAge)
return true;}
else{return false;}
canIDrive (18)
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 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
tekkub / array_to_hash.rb
Created December 9, 2011 23:50
Convert a ruby array into a hash
# 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