Skip to content

Instantly share code, notes, and snippets.

View cellularmitosis's full-sized avatar

Jason Pepas cellularmitosis

View GitHub Profile
@cellularmitosis
cellularmitosis / xev.log
Created October 4, 2015 19:40
xev output illustrating what appears to be a hardware bug in the keyboard of my HP ProBook 4530s. See http://unix.stackexchange.com/questions/233506/working-around-a-buggy-keyboard-hacking-an-input-stream
KeyPress event, serial 40, synthetic NO, window 0x2600001,
root 0x93, subw 0x0, time 63046084, (824,397), root:(828,422),
state 0x0, keycode 32 (keysym 0x6f, o), same_screen YES,
XLookupString gives 1 bytes: (6f) "o"
XmbLookupString gives 1 bytes: (6f) "o"
XFilterEvent returns: False
KeyPress event, serial 40, synthetic NO, window 0x2600001,
root 0x93, subw 0x0, time 63046247, (824,397), root:(828,422),
state 0x0, keycode 30 (keysym 0x75, u), same_screen YES,
@cellularmitosis
cellularmitosis / ViewController.swift
Created November 12, 2015 20:54
UIViewController containment bug demo
//
// ViewController.swift
// ContainerTimingBugDemo
//
// Created by Jason Pepas on 11/12/15.
// Copyright © 2015 Jason Pepas. All rights reserved.
//
/*
@cellularmitosis
cellularmitosis / ViewController.swift
Last active November 13, 2015 18:18
Workaround for UIViewController containment bug
//
// ViewController.swift
// ContainerTimingBugDemo
//
// Created by Jason Pepas on 11/12/15.
// Copyright © 2015 Jason Pepas. All rights reserved.
//
/*
//: Playground - noun: a place where people can play
import UIKit
struct Item {
var price: Int
var count: Int
}
enum VendingMachineError: ErrorType {
//: Playground - noun: a place where people can play
import UIKit
//: Playground - noun: a place where people can play
import UIKit
struct Item {
var price: Int
@cellularmitosis
cellularmitosis / gist:64d4a2d2d6dfa33916fc
Created January 19, 2016 19:25
Alternate take on the sequence protocol using AnyGenerator. See http://stackoverflow.com/a/26219833/558735
// paste this into a playground
import Foundation
class Car {
var name : String
init(name : String) {
self.name = name
}
}
@cellularmitosis
cellularmitosis / swagger.yaml
Created February 11, 2016 05:05
test of swagger 'enum' allowed values in response object.
swagger: '2.0'
info:
version: 1.0.0
title: PetStore on Heroku
description: |
**This example has a working backend hosted in Heroku**
You can try all HTTP operation described in this Swagger spec.
Find source code of this API [here](https://github.com/mohsen1/petstore-api)
@cellularmitosis
cellularmitosis / make_sysroot.py
Last active February 23, 2016 22:33 — forked from froody/make_sysroot.py
A fork of froody's make_sysroot.py which supports Debian Jessie (and thus armel).
#!/usr/bin/env python
# Install dpkg with `brew install dpkg libelf` before running this script
import argparse
import sys
import gzip
import urllib
import urlparse
import posixpath
import cStringIO
@cellularmitosis
cellularmitosis / gist:dd9c9cd3aa9be2e177d8
Created March 9, 2016 23:14
delete all but the latest three files
for i in `ls -1t *.tar.lzo | tail -n+4`
do
rm $i
done
@cellularmitosis
cellularmitosis / create_yosemite_iso.sh
Last active March 14, 2016 11:59
create_yosemite_iso.sh: Create a bootable .iso OS X Yosemite installer (for use with e.g. VirtualBox)
#!/bin/bash
# create_yosemite_iso.sh: Create a bootable .iso OS X Yosemite installer (for use with e.g. VirtualBox)
# See https://gist.github.com/cellularmitosis/6e902579296e82ec6273
# This is a (slightly) edited version of IOOI SqAR's script.
# See http://sqar.blogspot.de/2014/10/installing-yosemite-in-virtualbox.html
# Changes from IOOI SqAR's script include:
# * Use 'hdiutil makehybrid' to convert the .cdr image to a "real" .iso image.