Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am shxl on github.
  • I am shadwell (https://keybase.io/shadwell) on keybase.
  • I have a public key whose fingerprint is 2E84 5CDD F109 A53A FE11 6B86 DCC6 4838 E547 0BC1

To claim this, I am signing this object:

@shxl
shxl / index.html
Created December 19, 2016 13:39
replace images with turnip
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>turn up for what</title>
</head>
<body>
<a href='javascript: function Turnip(a,b){this.ratio=a,this.imageurl=b}function Randomize(a){return Math.floor(Math.random()*a.length)}function imageRatio(a){var b=a.height/a.width;return b>1?"vertical":1===b?"square":1>b?"horizontal":void 0}var getTurnip={init:function(a){this.myTurnip=a},horizontal:function(){return this.myTurnip.filter(function(a){return"horizontal"===a.ratio})},square:function(){return this.myTurnip.filter(function(a){return"square"===a.ratio})}},myTurnip=[new Turnip("horizontal","http://www.lovefoodhatewaste.com/sites/files/lfhw/image/turnip_swede.jpg"),new Turnip("horizontal","http://www.carpediemmag.co.uk/magazine/images/stories/carpediemimages-october2010/turnip.jpg"),new Turnip("horizontal","http://www.harvesttotable.com/wp-content/uploads/2009/06/Turnips-in-garden1.jpg"),new Turnip("horizontal","http://s.hswstatic.com/gif/turnip-image-250x150.jpg"),new Turnip("horizontal
@shxl
shxl / reorder.swift
Created January 14, 2016 21:51
reorder interaction w/o disgusting edit stuff
class SubjectTableViewController: UITableViewController {
var data = ["dan", "blair", "serena ;);)", "(i wish i was) chuck bass", "nate", "stupid jenny", "eric looked stupid blonde"]
override func viewDidLoad() {
super.viewDidLoad()
self.tableView.editing = true
}