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
// Compile with: | |
// http://subsimple.com/bookmarklets/jsbuilder.htm | |
(function(w) { | |
var r, i, u, t, | |
l = document.getElementsByTagName('link'), | |
ll = l.length; | |
for(i=0; i<ll; i++) { | |
if(l[i].getAttribute('rel') === 'alternate' |
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
<% all_methods = self.class.superclass.instance_methods - self.class.superclass.superclass.instance_methods %> | |
<% output_helpers = ::Padrino::Helpers::OutputHelpers.instance_methods %> | |
<% tag_helpers = ::Padrino::Helpers::TagHelpers.instance_methods %> | |
<% asset_tag_helpers = ::Padrino::Helpers::AssetTagHelpers.instance_methods %> | |
<% form_helpers = ::Padrino::Helpers::FormHelpers.instance_methods %> | |
<% render_helpers = ::Padrino::Helpers::RenderHelpers.instance_methods %> | |
<% number_helpers = ::Padrino::Helpers::NumberHelpers.instance_methods %> | |
<% blog_helpers = Middleman::Blog::Helpers.instance_methods %> | |
<% mm_methods = all_methods - output_helpers - tag_helpers - asset_tag_helpers - form_helpers - render_helpers - number_helpers %> |
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
# Rake convert:erb2:slim converts every ERB files under `/app/views/**`. | |
# Original ERB files will be kept otherwise `delete` option is passed like: | |
# `$ rake "convert:erb2:slim[delete]"` . | |
namespace :convert do | |
namespace :erb2 do | |
ERBS = FileList["#{Rails.root}/app/views/**/*.erb"] | |
### Slim | |
require 'html2slim' | |
# generate tasks for slim files |
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
$ brew install global --with-exuberant-ctags | |
$ brew link --overwrite ctags #remove ctags not exuberant |
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
;; auto-complete-mode | |
(setq ac-modes (append ac-modes '(objc-mode))) | |
(add-to-list 'load-path (expand-file-name "~/.emacs.d/vendor")) ;; Set your own Path to auto-complete-clang.el | |
(setq ac-clang-flags (list "-D__IPHONE_OS_VERSION_MIN_REQUIRED=30200" "-x" "objective-c" "-std=gnu99" "-isysroot" xcode:sdk "-I." "-F.." "-fblocks")) | |
(require 'auto-complete-clang) | |
;; (setq ac-clang-prefix-header "stdafx.pch") | |
;; (setq ac-clang-flags '("-w" "-ferror-limit" "1")) | |
;(setq clang-completion-flags (list "-Wall" "-Wextra" "-fsyntax-only" "-ObjC" "-std=c99" "-isysroot" "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk" "-I." "-F.." "-D__IPHONE_OS_VERSION_MIN_REQUIRED=30200")) | |
(add-hook 'objc-mode-hook | |
(lambda () (setq ac-sources (append '(ac-source-clang |
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
require 'formula' | |
class Emacs < Formula | |
homepage 'http://www.gnu.org/software/emacs/' | |
url 'http://ftpmirror.gnu.org/emacs/emacs-24.2.tar.bz2' | |
mirror 'http://ftp.gnu.org/pub/gnu/emacs/emacs-24.2.tar.bz2' | |
sha1 '38e8fbc9573b70a123358b155cf55c274b5a56cf' | |
if ARGV.include? "--use-git-head" | |
head 'http://git.sv.gnu.org/r/emacs.git' |
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
require 'formula' | |
class Emacs < Formula | |
homepage 'http://www.gnu.org/software/emacs/' | |
url 'http://ftp.gnu.org/pub/gnu/emacs/emacs-24.1.tar.gz' | |
md5 '97b78dece2b4fd617dfab26b7db2d4bc' | |
depends_on "autoconf" => :build | |
if ARGV.include? "--use-git-head" |
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
(define-key 'evil-motion-state-map "j" evil-next-visual-line) | |
(define-key 'evil-motion-state-map "k" evil-previous-visual-line) |
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
walk = (obj, fn, map = 'root') -> #fn(map, leaf) | |
if obj instanceof Array | |
for o in obj | |
walk o, fn, map + "[#{_i}]" | |
else if typeof obj is 'object' | |
for key of obj | |
walk obj[key], fn, map + ".#{key}" | |
else | |
fn map, obj |
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
;; When opened from Desktep entry, PATH won't be set to shell's value. | |
(let ((path-str | |
(replace-regexp-in-string | |
"\n+$" "" (shell-command-to-string "echo $PATH")))) | |
(setenv "PATH" path-str) | |
(setq exec-path (nconc (split-string path-str ":") exec-path))) |