du -sh ./*
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
thing_list = [] | |
f = File.open("/Users/ryan/Desktop/foobar.log", "r") | |
f.each_line do |line| | |
foo = Foo.where(id: 3).first | |
thing_hash = {} | |
if foo | |
thing_hash = {id: foo.id, stuff: foo.stuff} | |
thing_list << thing_hash | |
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
let x = { foo: "bar", test : true }; | |
y = { ...x, true: false, satyan: "eng" } // ==> y = { foo: "bar", test : false, ryan: "eng", satyan: "eng" } | |
let array = [1,2,3,4] | |
let newArray = [...array, 5,6,7] // => newArray = [1,2,3,4,5,6,7] |
Write routes.txt to file
rails routes > doc/routes.txt
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
# postgres being a little bitch | |
rm /usr/local/var/postgres/postmaster.pid |
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
x = [{1 => 'finish'}, {300 => 'color adder'}, {1000 => 'price group a'}] | |
x.map(&:keys).flatten.reduce(:+) |
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
1. Our website store cookies for displaying related content. | |
2. We respect your privacy. We won’t use your E-mail id and name other than sending you news letter ( if you have subscribed ). | |
3. We won’t share your personal data e.g. E-mail id, Contact Number with any third party. | |
4. We display some paid advertisement on the website,which may lead you to some external website.We are not responsible for the content of the external website. | |
5. Google, one of our third-party advertisers, may add a cookie to determine targeted advertisements based on your preferences and your visit to our site and other sites on the internet. You can choose to opt out of Google’s use of cookies by visiting the Google ad and content network privacy policy. |
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
# https://linux.die.net/man/1/wc | |
# count lines in linux dir with filename containing foobar | |
ls -l | grep foobar | wc -l |
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
// concatenate vars and strings | |
$ermsg = 'sampleNumber: ' . $sampleNumber . ', isSample: ' . $isSample . ', isSplit: ' | |
// kill execuation and dump var | |
die(var_dump($fooBarStix)); | |
// loop over multidimensional array | |
foreach($fooNumbers as $fooNumber) { | |
foreach($fooNumber as $k => $v) { | |
print $k |
OlderNewer