Skip to content

Instantly share code, notes, and snippets.

@rbrigby
rbrigby / m1-max-mac.md
Last active February 20, 2023 22:36
Setup a new M1 Max MacBook

M1 Max Config

Apparently github does not allow you to pop tabs. So just Right click and open tab in new tab

Important Links

Mac Prefs

  • install MacOS 13 Ventura
  • add 3 fingerprints (both index and right middle finger)
// 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
# https://linux.die.net/man/1/wc
# count lines in linux dir with filename containing foobar
ls -l | grep foobar | wc -l
@rbrigby
rbrigby / couldamade-privacy-policy
Created July 7, 2019 03:34
couldamade-privacy-policy
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.
@rbrigby
rbrigby / array-of-hashes-reduce.rb
Last active May 17, 2019 21:02
reduce an array of hashes with integer keys
x = [{1 => 'finish'}, {300 => 'color adder'}, {1000 => 'price group a'}]
x.map(&:keys).flatten.reduce(:+)
# postgres being a little bitch
rm /usr/local/var/postgres/postmaster.pid

Write routes.txt to file

rails routes > doc/routes.txt

@rbrigby
rbrigby / spread.js
Created December 4, 2018 20:22
JS Spread Operator
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]
@rbrigby
rbrigby / git.md
Last active December 5, 2018 21:46
Git Cheatsheet

update all remote branches

git fetch origin

rebase interactive

git rebase origin/master -i

git push origin featurebranch --force

rebase misc

git rebase --continue

@rbrigby
rbrigby / linux-cheat.md
Last active December 4, 2018 20:04
Linux CheatSheet

disk usage

du -sh ./*