Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am supernoveau on github.
  • I am supernoveau (https://keybase.io/supernoveau) on keybase.
  • I have a public key ASAVD1b12IXXNbnCbQ31tTAb7zH9tPS2QNEf3VT5o7FaLgo

To claim this, I am signing this object:

{"recommendations": ["CoenraadS.bracket-pair-colorizer", "msjsdiag.debugger-for-chrome", "mikestead.dotenv", "Tobermory.es6-string-html", "zjcompt.es6-string-javascript", "zh9528.file-size", "GrapeCity.gc-excelviewer", "spywhere.guides", "PKief.material-icon-theme", "stringham.move-ts", "christian-kohler.npm-intellisense", "techer.open-in-browser", "christian-kohler.path-intellisense", "esbenp.prettier-vscode", "tickleforce.scrolloff", "rbbit.typescript-hero", "vscodevim.vim", "Equinusocio.vsc-material-theme", "apollographql.vscode-apollo", "dbaeumer.vscode-eslint", "shanoor.vscode-nginx", "jpoissonnier.vscode-styled-components", "wayou.vscode-todo-highlight"]}

Keybase proof

I hereby claim:

  • I am almccann on github.
  • I am almccann (https://keybase.io/almccann) on keybase.
  • I have a public key ASBrGEyfCeNmz2LYKr_d-ik-Ew9Fbrk0ueyB4Crdz7mFTQo

To claim this, I am signing this object:

@supernoveau
supernoveau / jsonstats
Created November 14, 2018 01:46
parse_statistics_inno
[{'id': 1, 'STATUS': [{'Msg': 'CGMiner stats', 'When': 1542159818, 'Code': 70, 'STATUS': 'S', 'Description': 'sgminer 4.4.2'}], 'STATS': [{'09 HW errors': 17, '11 Temp': 0, '08 pllOptimal': False, 'Min': 99999999.0, '06 HW errors': 24, '07 PLL': 0, '02 nVol': 883, '10 Nonce ranges': 0, '11 Cooldown': 0, '04 Nonces found': 208, '02 Temp': 0, '01 Stales': 0, '07 Stales': 1, '03 HW errors': 16, '02 PLL': 0, '10 HW errors': 19, '00 Fail count': 0, '02 Nonce ranges': 0, 'Num active chips': 12, '04 Temp': 0, '09 Stales': 1, '10 Temp': 0, 'Elapsed': 79537, '08 Nonce ranges': 0, '05 pllOptimal': False, '09 PLL': 0, '10 Cooldown': 0, 'PLL': 354, '07 Fail reset': 32, 'Num cores': 384, '10 nVol': 899, '07 Temp': 0, '00 Stales': 0, '03 Fail reset': 32, '04 PLL': 0, '05 Temp': 0, '05 HW errors': 21, '04 Nonce ranges': 0, '11 pllOptimal': False, '03 pllOptimal': False, '06 Fail reset': 32, '09 Temp': 0, '03 Fail count': 3, '00 Temp': 0, '01 Nonces found': 217, '06 pllOptimal': False, '01 Fail count': 0, '00 PLL': 0, '07 Co
@supernoveau
supernoveau / output.txt
Last active October 11, 2019 22:29
cgminer `echo '{"command":"stats"}' | nc xx.xx.xx.xx 4028 >> ~/Desktop/output.txt`
{"STATUS":[{"STATUS":"S","When":1542065836,"Code":70,"Msg":"CGMiner stats","Description":"sgminer 4.4.2"}],"STATS":[{"STATS":0,"ID":"HLT0","Elapsed":3350,"Calls":0,"Wait":0.000000,"Max":0.000000,"Min":99999999.000000,"Chain ID":0,"Num chips":12,"Num cores":380,"Num active chips":12,"Chain skew":0,"Temp max":79.000000,"Temp min":55.000000,"Temp":65.000000,"Fan duty":25,"iVid":170,"PLL":354,"Voltage Max":903,"Voltage Min":873,"Voltage Avg":886,"VidOptimal":true,"pllOptimal":true,"VoltageBalanced":false,"Chain num":0,"MHS av":950000.000000,"Disabled":false,"Enabled chips":"fff","00 HW errors":2,"00 Stales":0,"00 Nonces found":7,"00 Nonce ranges":0,"00 Cooldown":0,"00 Fail count":0,"00 Fail reset":32,"00 Temp":0,"00 nVol":884,"00 PLL":0,"00 pllOptimal":false,"01 HW errors":0,"01 Stales":0,"01 Nonces found":9,"01 Nonce ranges":0,"01 Cooldown":0,"01 Fail count":0,"01 Fail reset":32,"01 Temp":0,"01 nVol":881,"01 PLL":0,"01 pllOptimal":false,"02 HW errors":2,"02 Stales":0,"02 Nonces found":14,"02 Nonce ranges":0,"02

Excel

Number every nth cell:
=MOD(ROW(),n) where n is a number

Fill down / right:
CTRL + D
CTRL + R

Show unique entries only:
=UNIQUE(A:B)

Rust

Rust setup

I'm using Atom (on a fairly speedy machine, VS Code has some solid plugin support too) with:

  • atom-beautify (with rustfmt installed, cargo install rustfmt) * language-rust * linter + linter-rust (using cargo check, cargo install cargo-check) * you-complete-me (but YCM is not fun to install, so I'd recommend the racer plugin, both require the Rust source cloned and installed somewhere)

1.\ You need to cargo install racer and add the bin to your path
2.\ Clone the Rust source of your version of Rust, and add that to your path
3.\ Install the plugin and set the paths in Atom

Rails

gem install bundler // install bundle
rvm osx-ssl-certs update all //Update RVM certifcates

Rails Routing Guide

HTTP Verb Path Controller#Action Used for
GET /photos photos#index display a list of all photos
GET /photos/new photos#new return an HTML form for creating a new photo
POST /photos photos#create create a new photo

Redis

redis-server // start redis
redis-cli // start redis CLI

nginx

sudo service nginx restart // restart service

Configuration file: /etc/nginx/sites-available

Symlink conf file: ln -s /etc/nginx/sites-available/eg.conf /etc/nginx/sites-enabled/eg.conf