start new:
tmux
start new with session name:
tmux new -s myname
module ActiveAdmin | |
module Reports | |
module DSL | |
def enable_reports | |
action_item only: :index do | |
link_to("Download", {action: :report, params: params}, {method: :post, data: { confirm: "Are you sure you want to generate this report?"}}) | |
end | |
collection_action :report, method: :post do |
# == Booting process | |
# | |
# The application is also responsible for setting up and executing the booting | |
# process. From the moment you require "config/application.rb" in your app, | |
# the booting process goes like this: | |
# | |
# 1) require "config/boot.rb" to setup load paths | |
# 2) require railties and engines | |
# 3) Define Rails.application as "class MyApp::Application < Rails::Application" | |
# 4) Run config.before_configuration callbacks |
require 'readline' | |
module Repl | |
module Command | |
class PWD | |
def self.parse argv=nil | |
dir = Repl::Container.dirs.last | |
'/' + (dir ? dir.join('/') : '') | |
end |
;; copy to clipboard from emacs in terminal | |
;; | |
;; if you use emacs in tmux you should enable pbcopy in tmux first | |
;; http://superuser.com/questions/231130/unable-to-use-pbcopy-while-in-tmux-session | |
(defun pbcopy-region (start end) | |
(interactive "r") | |
(pbcopy (buffer-substring start end))) | |
(defun pbcopy (string) |
# | |
# A C Parser using the Parslet library. | |
# | |
# ANSI C Grammar: | |
# | |
# * http://www.lysator.liu.se/c/ANSI-C-grammar-l.html | |
# * http://www.lysator.liu.se/c/ANSI-C-grammar-y.html | |
# | |
require 'parslet' |
RTEST(VALUE rb_obj)
rb_yield(VALUE rb_obj)
yield a value to given block. For multiple values, rb_assoc_new
them firstar -vx libssl-dev_1.0.1h-3_amd64.deb
tar -xvzf libssl-dev_1.0.1h-3_amd64.deb data.tar.xz
tar xvfJ data.tar.xz
module Hooka | |
class Returning < Struct.new(:value, :returning); end | |
def self.included(base) | |
base.extend ClassMethods | |
end | |
def returning(value=nil) | |
throw :hook_stop, Returning.new(value, true) |