Find:
:(\w+)[\s]+=>[\s]+
Replace:
$1:
This file contains 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
# => Start private_pub (Faye) as Deamon | |
RAILS_ENV=production bundle exec rackup private_pub.ru -s thin -E production -D | |
# => find Process on Port x | |
fuser -n tcp 9292 | |
-> 9292/tcp: 3748 | |
# => kill process | |
kill -9 3748 |
This file contains 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
(function($, undefined) { | |
/** | |
* Unobtrusive scripting adapter for jQuery | |
* | |
* Requires jQuery 1.6.0 or later. | |
* https://github.com/rails/jquery-ujs | |
* Uploading file using rails.js | |
* ============================= |
This file contains 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
# These are my notes from the PragProg book on CoffeeScript of things that either | |
# aren't in the main CS language reference or I didn't pick them up there. I wrote | |
# them down before I forgot, and put it here for others but mainly as a reference for | |
# myself. | |
# assign arguments in constructor to properties of the same name: | |
class Thingie | |
constructor: (@name, @url) -> | |
# is the same as: |
This file contains 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
Handle global ajax errors with jQuery: | |
$(document).ajaxError (xhr, status, error) => | |
console.log("Global ajaxError", arguments) | |
if xhr.status is 403 | |
window.location = "http://backend.myapp.com/login" | |
Handle individual jQuery ajax requests: | |
$.ajax( | |
url: url |
This file contains 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
class App.Root extends Spine.Stack | |
controllers: | |
resources: App.Resources | |
users: App.Users | |
routes: | |
'/resources' : 'resources' | |
'/users' : 'users' | |
default: 'users' |
This file contains 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
DB = (key) -> | |
store = window.localStorage | |
get: -> | |
JSON.parse store[key] or "{}" | |
put: (data) -> | |
store[key] = JSON.stringify(data) |