Skip to content

Instantly share code, notes, and snippets.

Avatar

Austin Bales arbales

View GitHub Profile
View gist:2582170
$ chrome app:push
# Checking manifest… [ OK ]
# Creating zip ball… [ OK ]
# Uploading to chrome.google.com [ OK ]
# Pushed `Kitten App v1.0.12`
#
# See chrome -h app:publish for publishing help.
$ chrome app:publish latest --app $CHROME_APP_IDENTIFIER
View ApplicationRouter.js.coffee
class ApplicationRouter extends Backbone.Router
ApplicationRouter.FEATURE_SPLASH_CURRENT_VERSION = 1
routes:
'' : '_index'
':workspaceId' : '_index'
':workspaceId/:type' : '_list'
':workspaceId/:type/:id' : '_detail'
':workspaceId/:type/:typeId/tasks/:taskId' : '_detail'
':workspaceId/projects/:projectId/activity' : '_activity'
View gist:2424995
[30] deathstar » u.update_attribute :avatar, nil
[2012-04-19 17:13:28] DEBUG ActiveRecord::Base : (0.1ms) BEGIN
[2012-04-19 17:13:28] DEBUG ActiveRecord::Base : User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."authentication_token" = 'HVFEqWx2Ez6skS6vLx4x' LIMIT 1
[2012-04-19 17:13:28] DEBUG ActiveRecord::Base : (0.4ms) UPDATE "users" SET "avatar" = '18b7c9da-fe75-4bce-b526-76f215026890.png', "authentication_token" = 'HVFEqWx2Ez6skS6vLx4x', "updated_at" = '2012-04-20 00:13:28.494414' WHERE "users"."id" = 2
[2012-04-19 17:13:28] DEBUG ActiveRecord::Base : (1.9ms) COMMIT
View config.ru
#!/usr/bin/env rackup
#\ -E deployment
# Put this file alongside the static content you'd like to serve
# then just run `rackup`
use Rack::ContentLength
app = Rack::Directory.new Dir.pwd
View sabrina.html
<html>
<head>
<script src="/path/to/jquery.js" type="text/javascript"></script>
<script src="/path/to/jquery.kittenize.js" type="text/javascript"></script>
<script src="/path/to/sabrina.js" type="text/javascript"></script>
<title>Sabrina</title>
</head>
<body>
<h1>Hi!</h1>
<p class='kittens'>Kittens go here.</p>
View gist:1714738
Feature: Keyboard Shortcut
In order to quickly save a bookmark to my inbox
As a Mac user
I want to be able to press a key combination and be given instant feedback
Scenario: Save grove.io
Given I have a browser tab open to http://grove.io
And I have the Kippt extension installed
When I press `Command` + `K`
Then the Kippt extension should illuminate
@arbales
arbales / handlebars-formatTextForHTML.coffee
Created Jan 22, 2012
Replace URLs with links and unicode emoji with images.
View handlebars-formatTextForHTML.coffee
LINK_DETECTION_REGEX = /(([a-z]+:\/\/)?(([a-z0-9\-]+\.)+([a-z]{2}|aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel|local|internal))(:[0-9]{1,5})?(\/[a-z0-9_\-\.~]+)*(\/([a-z0-9_\-\.]*)(\?[a-z0-9+_\-\.%=&amp;]*)?)?(#[a-zA-Z0-9!$&'()*+.=-_~:@/?]*)?)(\s+|$)/gi
EMOJI_DIRECTORY = "/path/to/assets/emoji/20x20"
# Handlebars is presumed, but you could swap out
ESCAPE_EXPRESSION_FUNCTION = Handlebars.Utils.escapeExpression
MARKSAFE_FUNCTION = (str) -> new Handlebars.SafeString(str)
# Emoji unicode chars become images.
View gist:1536467
cd /path/to/asq && \
git remote set-url origin git@github.com:arbales/asq.git && \
git remote add heroku git@heroku.com:asq.git
@arbales
arbales / bdd.mdown
Created Nov 12, 2011
Bourbon Driven Development
View bdd.mdown

BDD, Bourbon Driven Development
a state of optimum flow where programming bliss is achieved
through three fingers of the finest American whiskeys.
See also, Bourbon and Branching

View gist:1354013

I click a link in Facebook or Twitter, I don't care about the URL. I care about content.

Sure, that link points to a URL, but I don't know what it is, and I'll never remember it. It could even be a really sensible URL, like http://odopod.com/blog/hack-days-2011-coming-november/ — but I still won't remember it. URLs are implementation details for content on the web, not content in themselves.

People want to share. They're probably doing it with Facebook or Twitter. Being able to share a link to content isn't dependent on a native or non-native experience, it's neutral. Even if your native app had a URL bar, you wouldn't want to copy and paste that into a thing and send that thing to someone, you want to press share and press a person.

Look, I love web apps — I even build one for a living! But users consistently appreciate native apps on iPhone (this doesn't apply to Android) because of the constraints of the HIG and the SDK.