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 / JBSclaimedaddresses.txt
Last active October 10, 2018 00:06
JBS claimed addresses - Signed messages
JBS Address UBQ Address (message) Signature
JJgMRVtSsjaoj8ZwSeWmgYHxx3Lm4MmVEM 0x3e5429d2c0D046430709F2001867fC5dAEd5DC79 H2irrHUv4HAh85mVPMxsywPKz7HTdijIbAHiUp2aJPPFmSiiXE9UsF+q7GSbc9WeE9Qs4fSJHTqaMTnYDEPQoy4=
JK5cjW1BiiLB8AUGRThE7Gt4TeJE7uauhC 0xD53788af956e7622Cfd258669036d37F07CB8B29 IMiur7lgHPQRXVZxethw8GdKHk924eeZ0WmUWpYNj6aEdainejVrxerZoPb6wcwL5W0ttGxUcpBbtzyaWUki9VU=
JK7v1tvm87oMNkrQViJG7zbb64vqcV2oVH 0xfa99053b813C6E47b0e2dd561848B028AE5396B3 IHIflksnd9OGIXqH3yDmigCAxhh138UQIWNZiXMuWpTAXgOlI7iZl96jHFwdgv0h+ZpQUFTaUqIIQtqp0aWbZJ0=
JKCidRbYRU3H38t5fixW6npQXG8hnP5aP9 0xF7cd47d4354f54aAD36861Cba8d9B666989fd496 ICN6Oq8+8Fd5r1aQJ0PKAjZub0GyuXhAnDJgJAtTvQW0lwgR2XjIzX4JVJ7H57iTSXGKFSoO8jTGDV7yOhOYGlU=
JKEEEbhpGNkPmKGfjVatFypwcU94y1EpSK 0xbF54b793938e9C83A1b1eFd5c8101BFa7f14942B IM5aofC6WXis+g9k0m+anbIt0uQ44mJ810j4YuyG6OJTyz2jzyNm5rmcB2CdGove9vVGqXOP1cyzAoKY+3VAO/A=
JKF2JvWS9scV419TvNR6epRqLP1gzPAvQS 0xBA0d2d3BECc70b355E9A1971C
@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 / cryptodouble_ponzi.md
Last active August 29, 2015 14:13
Crypto Double - The anatomy of a Ponzi scheme

I've noticed that people still contemplate how a Ponzi scheme such as a site called Crypto Double works.

Wikipedia defines a Ponzi scheme as: A fraudulent investment operation where the operator, an individual or organization, pays returns to its investors from new capital paid to the operators by new investors, rather than from profit earned by the operator.

Here is an overview of a series of tweets I made which illustrates how this site works. Please note that there is nothing complicated about this site. There are no magical investors on the receiving end.

1) A Ponzi is "funded"

A large investment is put into the Ponzi scheme which can then fund the earlier participants.