Skip to content

Instantly share code, notes, and snippets.

View jyap808's full-sized avatar

Julian Yap jyap808

View GitHub Profile
@jyap808
jyap808 / Upgrade Yarn dependencies (and update package.json).md
Last active July 11, 2022 22:12
Upgrade Yarn dependencies (and update package.json)
jq '.dependencies | keys | .[]' package.json | xargs yarn add
jq '.devDependencies | keys | .[]' package.json | xargs yarn add --dev

FROM: yarnpkg/yarn#3266 (comment)

Install Yarn for every NVM install

Create a text file at $NVM_DIR/default-packages, usually it is located at ~/.nvm/default-packages, with a list of npm packages to be installed. The content may looks like the following:

@jyap808
jyap808 / useful.md
Created December 17, 2020 09:50
Useful random notes

Undo Git changes (also pushed Git changes)

In the server, move the cursor back to the last known good commit:

git push -f origin <last_known_good_commit>:<branch_name>

Locally, do the same:

git reset --hard 
@jyap808
jyap808 / UbiqNucleusBlock.json
Last active September 4, 2017 08:00
Ubiq Nucleus Block
{
"nonce": "0x0000000000000888",
"timestamp": "0x588CF840",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x0",
"gasLimit": "0x8000000",
"difficulty": "0x12A05F2000",
"extraData": "0x4a756d6275636b734545",
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x3333333333333333333333333333333333333333",
@jyap808
jyap808 / jbs_block_1284688.txt
Created April 2, 2017 11:25
Jumbucks - State of the ledger at block 1284688 (minted : Sat Jan 28 08:07:16 2017)
This file has been truncated, but you can view the full file.
---------------------------------------------------------------------------
State of the ledger at block 1284688 (minted : Sat Jan 28 08:07:16 2017)
---------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
Balance Hash160 Base58 nbIn lastTimeIn nbOut lastTimeOut
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
597245.70000000 5aa5ada8189f6b8f993a37c01b3e95bd2bd802ee JSoEdU717hvz8KQVq2HfcqV9A79Wihzusu 107 Fri Jan 27 19:55:28 2017 103 Fri Jan 27 22:51:12 2017
151186.72074621 5444bbb3cd652d0f4aaa065ad6baf20c98c5cf37 JSDWST7ufWikR9awYDr9BatxVfHcWxVyVh 17 Thu Jan 5 17:30:26 201
@jyap808
jyap808 / blake256.go
Created January 7, 2016 00:50
Blake 256 hash
package main
import (
"encoding/hex"
"fmt"
"github.com/decred/blake256"
)
func main() {
@jyap808
jyap808 / jumbucks_fantasy_football_draft_order.py
Created August 17, 2015 03:52
Jumbucks Fantasy Football Draft Order 2015
#!/usr/bin/python
import hashlib
names = []
names.append('Bombaklots')
names.append('Broncomania')
names.append('MtGox Frappuccinos')
names.append('SaintSlayers')
@jyap808
jyap808 / Dracula Coin.. Quick notes.md
Last active August 29, 2015 14:22
Dracula Coin.. Quick notes
@jyap808
jyap808 / Perl - Check a module is installed.md
Created March 4, 2015 19:59
Perl - Check a module is installed

If you want to quickly check if module is installed (at least on Unix systems, with bash as shell), add this to your .bashrc file:

alias modver="perl -e\"eval qq{use \\\$ARGV[0];\\\\\\\$v=\\\\\\\$\\\${ARGV[0]}::VERSION;};\ print\\\$@?qq{No module found\\n}:\\\$v?qq{Version \\\$v\\n}:qq{Found.\\n};\"\$1"

Then you can:

=&gt; modver XML::Simple
@jyap808
jyap808 / Paycoin Proof of Work analysis.md
Last active August 29, 2015 14:12
Paycoin Proof of Work analysis
@jyap808
jyap808 / AWS swap file.md
Created November 30, 2014 05:29
AWS swap file

Swap should take place on the Instance Storage (ephemeral) disk and not an EBS device. Swapping will cause a lot of IO and will increase cost on EBS. EBS is also slower than the Instance Store and the Instance Store comes free with the EC2 Instance.

It will usually be mounted to /mnt but if not run

sudo mount /dev/xvda2 /mnt

To then create a swap file on this device do the following for a 4GB swapfile