Skip to content

Instantly share code, notes, and snippets.

View steam's full-sized avatar

Sean Dougherty steam

View GitHub Profile
this is a gist
@steam
steam / machine.js
Created March 25, 2021 22:12
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@steam
steam / machine.js
Last active March 25, 2021 22:04
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions

XCode 9 & Friends

  • create a permanent section in the project structure for playgrounds
  • break separate chunks of code into frameworks
  • mousepose for showing keystrokes
  • use behaviors to preconfigure the editor to have specific tabs ie. search/debug/etc this is awesome

Debugging

  • Add accessibility labels to components, makes debugging easier (and helps with accessibility)
/*
Experiment that animates a red square left to right in a container
by swapping the priority of the left and right layout constraints
*/
import UIKit
import XCPlayground
let container = UIView(frame: CGRectZero)
container.backgroundColor = .whiteColor()
Pod::Spec.new do |s|
s.name = "Firebase"
s.version = "2.3.3"
s.summary = "The official iOS client library for Firebase."
s.homepage = "https://www.firebase.com/"
s.license = { :type => 'Commercial', :url => 'https://www.firebase.com/terms/terms-of-service.html' }
s.author = { "Firebase" => "support@firebase.com" }
s.source = { :http => "https://cdn.firebase.com/ObjC/Firebase.framework-2.3.3.zip" }
s.ios.deployment_target = "6.0"
#import <UIKit/UIKit.h>
@class AFNetworkReachabilityManager;
@interface ViewController : UIViewController
@property (nonatomic, weak) IBOutlet UILabel *internetStatusLabel;
/* "Injected" properties -- Each should have a corresponding @dynamic directive */
@property (strong, nonatomic) AFNetworkReachabilityManager *reachabilityManager;
@steam
steam / .cook
Created August 3, 2011 15:09 — forked from gvarela/.cook
default developer image
{
"imagemagick": {"ghostscript": true},
"redis": {"launchd": true},
"rvm": {"rubies": ["1.9.2", "ree", "rbx"]},
"cookbooks": ["https://github.com/gvarela/osx-cookbooks/tarball/master", "https://github.com/gvarela/osx-cookbooks-ext/tarball/master"],
"recipes": [
"homebrew",
"git",
"rvm",
{
"imagemagick": {"ghostscript": true},
"cookbooks": ["https://github.com/gvarela/osx-cookbooks/tarball/master", "https://github.com/gvarela/osx-cookbooks-ext/tarball/master"],
"recipes": [
"homebrew",
"git",
"redis",
"memcached",
"imagemagick",
function getCarsByBodyStyle( allModels, allBodyStyles, selectedBodyStyles ){
var cars = [];
var excludedBodyStyles = _.without.apply( this, [allBodyStyles].concat(selectedBodyStyles) );
_.each(allModels, function(model){
if( _.intersect( model.bodyTypes, excludedBodyStyles ).length == 0 ){
cars.push( parseInt( model.id ) );
}
});