Skip to content

Instantly share code, notes, and snippets.

View vlucas's full-sized avatar

Vance Lucas vlucas

View GitHub Profile
@hhatfield
hhatfield / redirector.sh
Created May 2, 2014 18:10
Bash redirector with command name
#!/bin/bash
outfile=${*: -1:1}
remove=1
echo "$@" > $outfile; "${@:1:$(($#-remove))}" >> $outfile
@jasonkneen
jasonkneen / sample.js
Last active August 29, 2015 14:01
DynamicLabel tag in Alloy - allows you to update a "value" and it applies it to a template. Place ui.js in your app/lib folder
$.recordCount.value = 99

How domain names turn into valid IPs

It's more than you probably think

  1. A user types the URL http://www.example.com into a browser.

  2. The browser sends a request for the IP address of www.example.com to its local resolver (stub-resolver).

  3. The stub-resolver queries the locally configured DNS Resolver for the IP address of www.example.com.

@kwhinnery
kwhinnery / points.md
Last active August 29, 2015 14:06
iOS Device Sizes for App Developers

[UIScreen mainScreen].bounds.size.height reports the following sizes, in points, for these iOS devices:

iPad Air/Mini/etc. (some require @2x assets)
  • Height: 1024
  • Width: 768
iPhone 6 Plus (401ppi display requires @3x assets)
  • Height: 736
/*!
* Parse JavaScript SDK
* Version: 1.3.2
* Built: Fri Nov 21 2014 16:31:10
* http://parse.com
*
* Copyright 2014 Parse, Inc.
* The Parse JavaScript SDK is freely distributable under the MIT license.
*
* Includes: Underscore.js
@getify
getify / 1.md
Created November 30, 2012 12:04
rethink how javascript "inheritance" ACTUALLY works...

JavaScript does not have "inheritance" or "prototypal inheritance" or "classes" or any of that jazz... what you've been told, and how you've been taught about it, are a misunderstanding... all this nonsense about constructor functions and new and such... that's all hogwash... well, it's all unnecessary effort, at best.

"Instead... only try to realize the truth... there is no spoon."

What JavaScript does have is "behavior delegation"... and object linking through the "prototype chain"... you merely link two instances of objects together, say Foo and Baz, and say that Baz "delegates" to Foo for any behavior that Baz doesn't own itself but that Foo does own. And thus, any object b (aka, "b is an instance of Baz" in the more confusing terminology) which is linked to Baz, delegates first to Baz, and then to Foo, for behavior.

That's it. Seriously. And function constructors and new and all that stuff, everything you've read before about OO in JS, they're just distractions that lea

Getting Started with Titanium (Redux)

Now that Titanium is starting to have a proper CLI, installing and using Titanium is 67% more awesome. At some of the CLI commands, you will be asked for config information and your Appcelerator login, but these are the high level steps:

  1. Sign up for an account at appcelerator.com
  2. Install node.js
  3. Install Xcode from the Mac App Store
  4. sudo npm install -g titanium
  5. titanium sdk install --default
  6. titanium create

Hypermedia API design session

Proposed/ran by Andreas Schmidt, Nokia

Based off his design around the Nokia Places API

Notes

  • Picked JSON, no support for XML
  • Added ?accept=application/json to the URL in the browser for a raw response
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.