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
ordinal_suffix_of = function(i) { | |
var j, k; | |
j = i % 10; | |
k = i % 100; | |
if (j === 1 && k !== 11) { | |
return i + 'st'; | |
} | |
if (j === 2 && k !== 12) { | |
return i + 'nd'; | |
} |
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
def self.stringify_keys(h) | |
h.is_a?(Hash) ? h.collect{|k,v| [k.to_s, stringify_keys(v)]}.to_h : h | |
end |
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
VENDOR_VERSION_HEADER_REGEX = /\Avnd\.([a-z0-9.\-_!#\$&\^]+?)(?:[-.](?:[-a-z0-9*.]+))?(?:\+([a-z0-9*\-._]+))\z/ |
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
curl "https://raw.githubusercontent.com/github/gitignore/master/Unity.gitignore" >> .gitignore |
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
module Probabilities | |
def prob(event_percentage, event_frequency = 1) | |
event_percentage ** event_frequency | |
end | |
def inverse_prob(event_percentage, event_frequency = 1) | |
1 - prob(event_percentage, event_frequency) | |
end | |
end |
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
.editor .gutter .line-number { | |
&[class*="git"] { | |
padding-left: 0 !important; | |
border-left: none !important; | |
color: #ffffff; | |
opacity: 1; | |
width: 40px; | |
} | |
&.git-line-added { |
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
require 'socket' | |
def try_connection | |
TCPSocket.new(ENV['DB_HOST'], 3306) | |
rescue Errno::ECONNREFUSED | |
false | |
else | |
true | |
end |
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
# install atom from repo | |
sudo add-apt-repository ppa:webupd8team/atom | |
sudo apt-get update | |
sudo apt-get install atom | |
# install favorite atom packages | |
apm install github-atom-light-syntax | |
apm install goto-definition | |
apm install open-in-browser | |
apm install language-haml |
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
cat tmp/pids/server.pid | xargs kill -9 |
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
+++++ +++++ * = | 10^| 0 | 0 | 0 | 0 | | |
[ * = | 10^| 0 | 0 | 0 | 0 | loops current cursor | |
>+ * = | 10 | 1^| 0 | 0 | 0 | | |
>+++ * = | 10 | 1 | 3^| 0 | 0 | | |
>+++++ ++ * = | 10 | 1 | 3 | 7^| 0 | | |
>+++++ +++++ * = | 10 | 1 | 3 | 7 | 10^| | |
<<<<- * = | 9v| 1 | 3 | 7 | 10 | | |
] * = | 0*| 10 | 30 | 70 | 100 | | |
>>>++. * = | 0 | 10 | 30 | 72^| 100 | print cursor value ASCII 72 = H | |
>+. * = | 0 | 10 | 30 | 72 | 101^| print cursor value ASCII 101 = e |
NewerOlder