Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
find . -name '*.sass' -exec sh -c 'git mv "$0" "${0%.sass}.css.sass"' {} \;
find . -name '*.coffee' -exec sh -c 'git mv "$0" "${0%.coffee}.js.coffee"' {} \;
@josephj
josephj / Guardfile
Last active December 19, 2015 11:09
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
guard 'livereload', port: '35730' do # Default port is 35729.
watch(%r{app/views/.+\.(erb|haml|slim)$})
watch(%r{app/helpers/.+\.rb})
watch(%r{public/.+\.(css|js|html)})
watch(%r{config/locales/.+\.yml})
# Rails Assets Pipeline
watch(%r{(app|vendor)(/assets/\w+/(.+\.(css|js|html))).*}) { |m| "/assets/#{m[3]}" }
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
guard 'livereload' do
watch(%r{app/views/.+\.(erb|haml|slim)$})
watch(%r{app/helpers/.+\.rb})
watch(%r{public/.+\.(css|js|html)})
watch(%r{config/locales/.+\.yml})
# Rails Assets Pipeline
watch(%r{(app|vendor)(/assets/\w+/(.+\.(css|js|html))).*}) { |m| "/assets/#{m[3]}" }
#!/bin/sh
/usr/bin/vimdiff "$2" "$5"
[alias]
f = fetch
st = status
s = status
br = branch
rb = svn rebase
c = commit
ci = commit
cp = cherry-pick
co = checkout
@josephj
josephj / config.json
Created June 20, 2013 00:19
CoffeeLint configuration file.
{
"arrow_spacing": {
"level" : "error"
},
"camel_case_classes" : {
"level" : "error"
},
"coffeescript_error" : {
"level" : "error"
},
@josephj
josephj / en.yml
Last active December 18, 2015 16:19
# L10N Convention
#
# - Create category according to routing's 1st segment. (Maybe partial's module name?)
# - Keep alphabetical order to avoid duplication.
# - Naming with structure instead of directly translating.
en:
generic: # Reusable
actions:
cancel_button: 'Cancel'
delete_button: 'Delete'
@josephj
josephj / happy-desinger-mini-1.md
Last active December 18, 2015 10:39
於 HappyDesigner Mini #1 分享會

JavaScript 品質工具:CodePaint 與 Plato

介紹協助提昇 F2E Code Style 的兩個工具。

分享者

josephj@faria

問題

root = true
[*.js]
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true
quote_type = double
spaces_around_operators = true
space_after_control_statements = true
#!/usr/bin/php
<?php
// Set constants.
$js_pattern = "/\.js$/";
// Set default variables.
$return = 0;
$exit_status = 0;
$output = array();
$matches = array("js" => array());