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
# Migration generator shortcuts. | |
# rails generate migration MyNewMigration | |
# rails generate migration add_fieldname_to_tablename fieldname:string | |
# rails generate model Product name:string description:text | |
# The set of available column types [:string, :text, :integer, :float, :decimal, :datetime, :timestamp, :time, :date, :binary, :boolean] | |
# A migration is a subclass of ActiveRecord::Migration. You must implement the "up" and "down" (revert) methods. | |
# These are the handy methods available to a Migration: |
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
#!/usr/bin/env bash | |
curl https://s3.amazonaws.com/heroku-jvm-buildpack-vi/vim-7.3.tar.gz --output vim.tar.gz | |
mkdir vim && tar xzvf vim.tar.gz -C vim | |
export PATH=$PATH:/app/vim/bin |
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
alias branches="git for-each-ref --sort=-committerdate refs/heads/ --format='%1B[0;32m%(authorname)%09%1B[0;36m(%(committerdate:relative))%09%1B[0;33m%(refname:short)%09%1B[m% (subject)' --count 10 | tail -r | column -t -s $'\t'" |
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
# Player 1 plays 0s | |
# Player 2 plays 1s | |
if item.even? | |
box[move] = 'X' | |
elsif item.odd? | |
box[move] = '0' | |
end | |
# Did player 1 win? | |
if item.odd? and item > 3 and player_winner?(box, '0') |
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
#!/usr/bin/env ruby | |
# Read this blog to know more about this script. | |
# | |
# http://blog.bigbinary.com/2013/09/19/do-not-allow-force-pusht-to-master.html | |
class PrePushHandler | |
def handle | |
reject if pushing_to_master? && forced_push? |
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
describe 'Deal Term Display', -> | |
HTML = '<div deal-terms></div>' | |
scope = elem = DealTerm = null | |
beforeEach -> | |
inject ($compile, $rootScope, _DealTerm_) -> | |
DealTerm = _DealTerm_ | |
scope = $rootScope.$new() | |
scope.log = deal_terms: [] | |
scope.showthis = true |
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
= f.input :space_condition, collection: ['raw', 'pre-existing', 'pre-built', 'white box', 'core and shell'], label_method: :capitalize, label: "Space condition", :input_html => {:id => "space_condition_{{$index}}", :'ng-model' => 'space.space_condition', :'ng-init' => 'space.space_condition=""'} |
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
I narrowed it down: | |
1. The element on the right must be in the DOM before the element on the left, and have float: right | |
2. The element on the left must have display: block, float: none, white-space: nowrap, overflow: hidden, text-overflow: ellipsis |
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
$document.on 'nested:fieldAdded and:again', (event) -> | |
$scope.$apply -> | |
$compile(event.field)($scope) | |
true | |
true |
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
- object_id = f.object_name.gsub(/[^0-9]+/,'') || f.options[:child_index] |
NewerOlder