Skip to content

Instantly share code, notes, and snippets.

View irskep's full-sized avatar
💭
~emo song lyrics~

Steve Landey irskep

💭
~emo song lyrics~
View GitHub Profile
var Safari = Application('Safari');
var SystemEvents = Application('System Events');
var SafariEvents = SystemEvents.processes['Safari'];
var openDevTools = function(deviceName, appName) {
var getDevSubMenuItem = function(i) {
return SafariEvents.menuBars[0]
.menuBarItems['Develop'].menus['Develop']
.menuItems[deviceName].menus[deviceName]
@irskep
irskep / literallycanvas.js
Created May 2, 2015 19:24
Literally Canvas 0.4.2 release candidate
!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.LC=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
},{}],2:[function(_dereq_,module,exports){
var INFINITE, JSONToShape, LiterallyCanvas, Pencil, actions, bindEvents, createShape, math, shapeToJSON, util, _ref,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__slice = [].slice;
actions = _dereq_(
!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.LC=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
},{}],2:[function(_dereq_,module,exports){
var INFINITE, JSONToShape, LiterallyCanvas, Pencil, actions, bindEvents, createShape, math, renderShapeToContext, renderShapeToSVG, shapeToJSON, util, _ref,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.LC=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
},{}],2:[function(_dereq_,module,exports){
var INFINITE, JSONToShape, LiterallyCanvas, Pencil, actions, bindEvents, createShape, math, renderShapeToContext, renderShapeToSVG, shapeToJSON, util, _ref,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.LC=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
},{}],2:[function(_dereq_,module,exports){
var INFINITE, JSONToShape, LiterallyCanvas, Pencil, actions, bindEvents, createShape, math, renderShapeToContext, renderShapeToSVG, shapeToJSON, util, _ref,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
/*
self.view.addConstraints(NSLayoutConstraint.hip_constraintsWithVisualFormats(
["H:|[label]|", "V:|[label]|"], options: [], metrics: nil, views: ["label": label]))
*/
extension NSLayoutConstraint {
class func hip_constraintsWithVisualFormats(
formats: [String], options: NSLayoutFormatOptions, metrics: [String: AnyObject]?, views: [String: AnyObject])
-> [NSLayoutConstraint]
{
// https://gist.github.com/jstn/d93c86f7bd2b6f22f0bf
/*
var b = Benchmarker()
b.start()
// do something
b.stop()
println("took \(b.milliseconds) ms")
*/
import Darwin
KissUp is extensible BBCode with Markdown syntactic sugar for use in technical
documentation.
"Keep It Simple: Stupid markUp"
Principles
==========
* The user shall never have to look up syntax rules after one hour of
experience with the language.
// BB_WORD: a valid tag name; essentially a string literal terminated by whitespace or a reserved character
// TEXT: non-BBCode text (i.e. string literal)
// BB_VAL: A string literal inside a BBCode tag
// e.g. [img src="foo"] matches [BB_WORD BB_WORD=BB_VAL]
Stmts -> Stmt Stmts
| ε
Stmt -> TEXT
| Tag
# reasonable language
let x = myList
.map({
mapFunc($0)
})
.filter({
filterFunc($0)
})
.reduce(0, {
$0 + $1