Skip to content

Instantly share code, notes, and snippets.

View ticky's full-sized avatar
💽

Jessica Stokes ticky

💽
View GitHub Profile
#!/usr/bin/env python
# Trying to achieve a command line option list like this
# argparsetest.py [--url <url> [[--string <string>] [--string-two <string>] | --boolean [--number <number>]]]
# This crashes if you pass it --help. Why?
from argparse import ArgumentParser
parser = ArgumentParser('demonstration of argparse issue')
"use strict";
/* Create a Constructor with an arbitrary name *
* This allows the resultant object to be of a *
* named "type", allowing inspection of types *
* without adding keys to the object itself */
function constructorNamed(name) {
return (new Function(["return function ", name, "() {return this;}"].join('')))();
}
@ticky
ticky / dabblet.css
Created April 7, 2014 09:35
Windows 98
/**
* Windows 98
*/
* {
box-sizing: border-box;
cursor: default;
user-select:none;
}
.selectable, input[type=text], input[type=email], textarea {
// ==UserScript==
// @name ID Linker
// @namespace http://geoffstokes.net/
// @include *
// ==/UserScript==
(function () {
// TODO: Search up the DOM tree for the nearest ID.
Array.prototype.slice.call(document.querySelectorAll('[id]')).forEach(function (element) {
element.addEventListener('click', function (event) {
if (event.button === 1 && event.altKey) {

Local (OS X) Side

~/Library/LaunchAgents/pbcopy.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
     <key>Label</key>
     <string>localhost.pbcopy</string>
require "formula"
class Kbbutil < Formula
homepage "https://github.com/MaffC/beautiful-lifestyle/tree/master/kbbutil"
url "https://github.com/MaffC/beautiful-lifestyle/archive/c806e228ec219cfbe53054f2b486f3f41f11a92f.zip"
sha1 "a0865d70d5adc3f72677b87d024934729401d8c6"
version "1.0.0"
def install
system "cd kbbutil && make"
@ticky
ticky / hybrid.js
Last active August 29, 2015 14:26
Which of the following code styles do you prefer? Fill in the quick-n-dirty survey at https://docs.google.com/forms/d/15IclgXrAhMS5d8jihzHBfUiMYYF8JAxvZTzFl9GTh-E/viewform
const n = true
? 'YAY'
: 'never';
blam
.boom()
.echo(n);
const o = {
gist: true,

Misty's Dad's Burritos (vegetarian version (metric edition))

Ingredients

  • 680g tempeh
  • 3 cloves garlic
  • 1 cup vegetable stock
  • 3 cups water
  • 4-4½ TBsp chili powder
  • 1½ tsp leaf oregano

Keybase proof

I hereby claim:

  • I am ticky on github.
  • I am ticky (https://keybase.io/ticky) on keybase.
  • I have a public key whose fingerprint is FC89 26EF 238B 59F3 F7B7 CAF1 E3DE 5BE0 38F7 0FE9

To claim this, I am signing this object:

@ticky
ticky / isComplete.py
Last active October 12, 2015 20:47
Detect if a set of numbers is complete and consecutive
#!/bin/env python
# coding: utf-8
items = [
[1, 2, 3, 5, 6, 7, 7, 8, 9, 10,11,12], # false
[2, 3, 4, 5, 6, 7, 8, 9, 10,11,12], # false
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], # true
[1, 2, 2, 4, 5, 6, 7] , # false
[1, 2, 3, 4, 5, 7] , # false
[3, 5, 1, 2, 4] # true