I hereby claim:
- I am imrohan on github.
- I am rohanlikhite (https://keybase.io/rohanlikhite) on keybase.
- I have a public key ASArKbJOWKNkeeIBwSWX7hEfT1PES0capni8a8J9LiAdpQo
To claim this, I am signing this object:
| How to undo published commits | |
| git reset (sha) | |
| git checkout (all files that need to be undone) | |
| git commit -am (message for reset) | |
| git push -f origin (branch name) |
| /* Returns the next back off interval for POST request */ | |
| func nextBackOffTime() time.Duration { | |
| collisionNumber := float64(networkStatus.failCount) | |
| backoffTime := time.Duration((math.Pow(2, collisionNumber) - 1) / 2) | |
| return backoffTime | |
| } |
| // Download a playlist from index, and skip errors | |
| sudo youtube-dl -i --playlist-start 0 [link] | |
| -i = continue on error (skip song) | |
| --playlist-start [index] = start downloading at a index | |
| // Download a mp3 form youtube | |
| sudo youtube-dl --extract-audio --audio-format mp3 -o "%(title)s.%(ext)s" [link] | |
| // Download mp3 from Soundcloud ignore errors | |
| sudo youtube-dl -i -o "%(title)s.%(ext)s" [link] |
| Latency Comparison Numbers | |
| -------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
| formatAllotmentValue = (value) -> | |
| _value = parseFloat(value) | |
| if parseFloat((_value%(Math.floor(_value))).toFixed(1)) >= 0.5 | |
| return Math.floor(_value) + 0.5 | |
| else | |
| return Math.floor(_value) |
| =Create Tests= | |
| rails g integration_test name_of_test | |
| =Running Tests= | |
| rake (all tests) | |
| rake test:[models, integration] | |
| ruby -I"lib:test" path/to/test_file.rb -n "test_name_of_test" | |
| =Debug= | |
| save_and_open_page |
I hereby claim:
To claim this, I am signing this object:
| =Navigating= | |
| visit('/projects') | |
| visit(post_comments_path(post)) | |
| =Clicking links and buttons= | |
| click_link('id-of-link') | |
| click_link('Link Text') | |
| click_button('Save') | |
| click('Link Text') # Click either a link or a button | |
| click('Button Value') |
| Verifying that +likhite is my blockchain ID. https://onename.com/likhite |
| generateRandomColor: (mix) -> | |
| red = Math.random() * 256 >> 0 | |
| green = Math.random() * 256 >> 0 | |
| blue = Math.random() * 256 >> 0 | |
| if mix != null | |
| red = (red + mix.red) / 2 >> 0 | |
| green = (green + mix.green) / 2 >> 0 | |
| blue = (blue + mix.blue) / 2 >> 0 | |
| rr = red.toString(16) |