- Smarter completion:
- cd tab completion -- directories only
- bash can do this, but needs the bash-completion package, usually comes separately
- zsh always comes with completions, why doesn't bash?
- Filename correction during completion
- if dir1/x exists and dir2 exists, then "dir/x<TAB>" completes to dir1/x
- if name1 is a file and name2 is a directory with files in it, "name/<TAB>" completes to "name2/"
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
# it is forked from https://github.com/xijo/reverse-markdown/blob/master/reverse_markdown.rb | |
require 'rexml/document' | |
require 'benchmark' | |
include REXML | |
include Benchmark | |
class ReverseMarkdown | |
# set basic variables: | |
# - @li_counter: numbering list item (li) tags in an ordered list (ol) |
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
;; init.el | |
;; Vincent Foley - [email protected] | |
(require 'cl) | |
(defmacro when-package-installed (package-name &rest body) | |
`(if (package-installed-p ,package-name) | |
(progn ,@body) | |
(warn "package %s is not installed" ,package-name))) |
Tired of waiting for emacs to start on OS X? This step by step guide will
teach you how to install the latest version of emacs and configure it to start
in the background (daemon mode) and use emacsclient
as your main editor.
First you'll need to install the [Homebrew package manager][brew] if yo haven't already. It is amazing.
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
demo |
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
# config/locales/en.yml | |
en: | |
i18n: | |
language: | |
name: 'English' |
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
# /rake/minirecord.rake | |
namespace :mini_record do | |
desc "Auto migration of database" | |
task :migrate => :environment do | |
Dir["models/*.rb"].each do |file_path| | |
basename = File.basename(file_path, File.extname(file_path)) | |
clazz = basename.camelize.constantize | |
clazz.auto_upgrade! if clazz.ancestors.include?(ActiveRecord::Base) | |
end | |
end |
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
Git.io.generate 'https://gist.github.com/gists/1355677' | |
Git.io.generate 'https://github.com/gimi', 'gimi' | |
Git.io.recognize 'http://git.io/gimi' |
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
# check if exist real page ! | |
if template_exists?(params[:id], "frontend", false) | |
render "frontend/#{params[:id]}" and return | |
end |
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
get :staff do | |
# render :markdown, :staff | |
render :markdown, :staff , :layout_engine => :haml, :layout => :application | |
end |