- By Edmond Lau
- Highly Recommended 👍
- http://www.theeffectiveengineer.com/
- They are the people who get things done. Effective Engineers produce results.
# 0 is too far from ` ;) | |
set -g base-index 1 | |
# Automatically set window title | |
set-window-option -g automatic-rename on | |
set-option -g set-titles on | |
#set -g default-terminal screen-256color | |
set -g status-keys vi | |
set -g history-limit 10000 |
#!/bin/bash | |
git branch -d -r `git branch -r | awk '{ if ($0 !~ /next|master/) printf "%s", $0 }'` | |
git branch -D `git branch | awk '{ if ($0 !~ /next|master/) printf "%s", $0 }'` |
$ git branch -r --merged origin/master | | |
grep origin | | |
grep -v '>' | | |
grep -v master | | |
xargs -L1 | | |
awk '{split($0,a,"/"); print a[2]}' | | |
xargs git push origin --delete |
class LastPayReport | |
def initialize employees | |
@employees = employees | |
end | |
def get_rows | |
@employees.map do |employee| | |
employee.compensations.last_two |
class UsersField < ActiveRecord::Base | |
belongs_to :user | |
belongs_to :field | |
has_one :fields_group, through: :field | |
validates :value, allow_blank: true | |
def create_record | |
if !self.field.required & self.value.blank? |
<%= simple_form_for @product do |f| %> | |
<%= f.simple_fields_for :attributes do |d| %> | |
<% f.object.attributes.try(:each) do |key, value| %> | |
<%= d.input key, :input_html => {:value => value } %> | |
<% end %> | |
<% end %> | |
<% end %> |
class FileQueue | |
def initialize(file_name) | |
@file_name = file_name | |
end | |
def push(obj) | |
safe_open('a') do |file| | |
file.write(obj + "\n") | |
end |
#! /bin/bash | |
### BEGIN INIT INFO | |
# Provides: unicorn | |
# Required-Start: $local_fs $remote_fs $network $syslog | |
# Required-Stop: $local_fs $remote_fs $network $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the unicorn web server | |
# Description: starts unicorn |
#!/bin/sh | |
# | |
# init.d script for single or multiple unicorn installations. Expects at least one .conf | |
# file in /etc/unicorn | |
# | |
# Modified by [email protected] http://github.com/jaygooby | |
# based on http://gist.github.com/308216 by http://github.com/mguterl | |
# | |
## A sample /etc/unicorn/my_app.conf | |
## |