This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| window.fbAsyncInit = function() { | |
| FB.Event.subscribe('edge.create', function(response) { | |
| alert('Thanks for liking!'); | |
| console.log(resposne); | |
| }); | |
| FB.Event.subscribe('edge.remove', function(response) { | |
| alert('Sad to see you dont like me :('); | |
| console.log(response); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| isTrigger() // returns true or false whether or not in Trigger.io environment | |
| request.get(url, callback) // will use Trigger's request.get or $.ajax JSONP | |
| log.info(message) // logger helper that will use Trigger's logger or console.log | |
| // available log levels are debug, info, warning, error, critical | |
| // See https://github.com/abronte/TriggerHelpers/blob/master/src/logger.coffee |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| brunch new MyApp --skeleton git@github.com:abronte/brunch-with-trigger.git |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "error": { | |
| "message": "Unsupported get request.", | |
| "type": "GraphMethodException", | |
| "code": 100 | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'bigquery' | |
| opts = {} | |
| opts['client_id'] = '1234.apps.googleusercontent.com' | |
| opts['service_email'] = '1234@developer.gserviceaccount.com' | |
| opts['key'] = '/path/to/somekeyfile-privatekey.p12' | |
| opts['project_id'] = '54321' | |
| opts['dataset'] = 'yourdataset' | |
| bq = BigQuery.new(opts) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| tell application "Google Chrome" | |
| activate | |
| set theUrl to "http://calendar.google.com" | |
| if (count every window) = 0 then | |
| make new window | |
| end if | |
| tell window 1 to make new tab with properties {URL:theUrl} | |
| end tell |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| filetype on | |
| augroup vimrc_filetype | |
| autocmd! | |
| autocmd FileType ruby call s:RubyCommenter() | |
| autocmd FileType vim call s:VimCommenter() | |
| augroup end | |
| map _ :s/^\/\/\\|^--\\|^> \\|^[#"%!;]//<CR>:nohlsearch<CR> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " Clear all types of comments | |
| map _ :s/^\/\/\\|^--\\|^> \\|^[#"%!;]//<CR>:nohlsearch<CR> | |
| " Add a # comment at the begining | |
| map - :s/^/#/<CR>:nohlsearch<CR> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| HOST="email.com:1234" | |
| USER="username" | |
| PASS="password" | |
| LCD="/path/to/local/dir" | |
| RCD="/path/to/remote/dir" | |
| if [ ! -e "/tmp/xfer" ] | |
| then | |
| touch /tmp/xfer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| stringDistance: function(s1, s2) { | |
| // sift3: http://siderite.blogspot.com/2007/04/super-fast-and-accurate-string-distance.html | |
| if (s1 == null || s1.length === 0) { | |
| if (s2 == null || s2.length === 0) { | |
| return 0; | |
| } else { | |
| return s2.length; | |
| } | |
| } |