Skip to content

Instantly share code, notes, and snippets.

@webhat
webhat / gist:3772793
Created September 23, 2012 19:44
Add File to Evernote with Tags
on run {input}
tell application "Evernote"
repeat with SelectedFile in input
try
display dialog "Tags for " & SelectedFile default answer ""
set value to text returned of result
set AppleScript's text item delimiters to ","
set the_tags to text items of value
set the_tags to the_tags & {"file", "paper", "book"}
@webhat
webhat / keeniolab.js
Created June 6, 2013 12:34
Keen.IO Resource Factory with Service Model
'use strict';
angular.module('keeniolab', ['ngResource']).
factory('KeenIO',function ($resource) {
var KeenIO = $resource('https://api.keen.io/3.0/projects/513a76812975164a4a000002/queries/:type',
{
api_key: 'api-key',
event_collection: 'read',
timezone: 7200
}, {
update: { method: 'PUT' }

Behavior Driven Development

Description of BDD

  • Domain-driven design

Principles of BDD

  • Enough is enough

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@webhat
webhat / github.cap
Last active January 2, 2016 21:19
I use this capistrano task to solve the Know Host bug that github has. https://help.github.com/articles/deploying-with-capistrano#known-hosts-bug
namespace :github do
desc 'Add Github to known hosts'
task :ssh do
on roles(:all) do
execute "echo 'github.com,207.97.227.239 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==' >> ~/.ssh/known_hosts"
end
end
end
@webhat
webhat / ssh-exchange.sh
Last active August 29, 2015 13:57
Add your ssh key to a new remote version
#!/bin/sh
KEY="$HOME/.ssh/id_rsa.pub"
U=$2
echo $U
if [ -z "$U" ] ;then
U=deploy
@webhat
webhat / index.html
Last active August 29, 2015 13:57
A Pen by Daniel W. Crompton.
<body>
<div id='course_list'></div>
</body>
@webhat
webhat / Oplerno-SignIn-Devise-Page.markdown
Created May 6, 2014 13:41
A Pen by Daniel W. Crompton.
@webhat
webhat / css-flex-box.markdown
Last active August 29, 2015 14:11
CSS flex-box