emacs --daemon to run in the background.
emacsclient.emacs24 <filename/dirname> to open in terminal
NOTE: "M-m and SPC can be used interchangeably".
- Undo -
C-/ - Redo -
C-? - Change case: 1. Camel Case :
M-c2. Upper Case :M-u
- Lower Case :
M-l
| #!/bin/bash | |
| # Install dependencies | |
| # older ubuntus | |
| #apt-get install build-essential libsqlite3-dev ruby1.9.1-dev | |
| # xenial | |
| apt install build-essential libsqlite3-dev ruby-dev | |
| # Install the gem | |
| gem install mailcatcher --no-ri --no-rdoc |
| #!/bin/sh | |
| # | |
| # Mac OSX Adblocker Script for IPv4 | |
| # Description: Blocks ads using system hosts file /private/etc/hosts, Ad-Domains would be redirected to 0.0.0.0 | |
| # Author: Daniel Hochleitner | |
| # Created: 10.09.2015 | |
| # Use: sudo ./adblock_hosts.sh | |
| # Get original hosts file from /private/etc/hosts |
| require 'net/http' | |
| require 'json' | |
| require 'uri' | |
| @token = '' | |
| def list_files | |
| ts_to = (Time.now - 30 * 24 * 60 * 60).to_i # 30 days ago | |
| params = { | |
| token: @token, |
emacs --daemon to run in the background.
emacsclient.emacs24 <filename/dirname> to open in terminal
NOTE: "M-m and SPC can be used interchangeably".
C-/C-?M-c
2. Upper Case : M-uM-l| ## From Lynda.com course 'RSpec Testing Framework with Ruby' | |
| describe 'Expectation Matchers' do | |
| describe 'equivalence matchers' do | |
| it 'will match loose equality with #eq' do | |
| a = "2 cats" | |
| b = "2 cats" | |
| expect(a).to eq(b) |
| # config/initializers/compression.rb | |
| Rails.application.configure do | |
| # Use environment names or environment variables: | |
| # break unless Rails.env.production? | |
| break unless ENV['ENABLE_COMPRESSION'] == '1' | |
| # Strip all comments from JavaScript files, even copyright notices. | |
| # By doing so, you are legally required to acknowledge | |
| # the use of the software somewhere in your Web site or app: |
| #!/bin/bash | |
| # before you can use this, you need to run (as root): | |
| # git clone https://github.com/tt/stack-images.git /root/stack-images | |
| # git clone https://github.com/gliderlabs/herokuish.git /root/herokuish | |
| # First, we need to get our base ubuntu images up to date | |
| docker pull ubuntu-debootstrap:14.04 | |
| docker pull ubuntu:trusty # for postgresql |
Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.
This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.
You are encouraged to fork this and modify it to your heart's content to match your own needs.
This is a collection of links, examples and rants about Presenters/Decorators in Rails.
The "Decorator" pattern slowly started gaining popularity in Rails several years ago. It is not part of core Rails, and there's many different interpretations about how it should work in practice.
Jay Fields wrote about it in 2007 (before he switched back to Java and then Clojure): http://blog.jayfields.com/2007/03/rails-presenter-pattern.html