Skip to content

Instantly share code, notes, and snippets.

View Eunoia1729's full-sized avatar
:octocat:
Looking out for awesome projects to contribute

Eunoia Eunoia1729

:octocat:
Looking out for awesome projects to contribute
View GitHub Profile
int test() {
// initalize dp[i][0] with 1
// dp[index][jumps_used]
result = 0;
for(int i = 0; i < n; ++i) {
for(int j = 0; j <= 3; ++j) {
for(int k = 1; k <= 3; ++k) {
if( i - k >= 0 and v[i] == v[i - k] and j - k >= 0) {
dp[i][j] = max(dp[i][j], 1 + k + dp[i - k][j - k)]);
}
@Eunoia1729
Eunoia1729 / bitcoin_core_verify.sh
Last active May 18, 2022 00:36
Script to verify Bitcoin Core 22.0+ release on Linux machines
#!/usr/bin/env bash
curlopts=( --silent --fail --max-time 10 --stderr /dev/null )
keyfile='https://raw.githubusercontent.com/bitcoin/bitcoin/master/contrib/builder-keys/keys.txt'
pubring='pubring.kbx' #may be trustedkeys.kbx on some systems
if [ ! -e SHA256SUMS ] || [ ! -e SHA256SUMS.asc ]; then
echo "missing SHA256SUMS/SHA256SUMS.asc files"
echo "download from https://bitcoincore.org/en/download/"
exit 1
@Eunoia1729
Eunoia1729 / schnorr_sig_chart.md
Last active May 15, 2022 06:17
Schnorr & Adapter Signature flowchart
  flowchart TD
    classDef root fill:#f96;
    classDef expr fill:#ff0;
    classDef leaf fill:#0f0;
    A:::root
    A2:::root
    A3:::root
    A4:::root
    A5:::root
@Eunoia1729
Eunoia1729 / india_states_codes.json
Last active March 23, 2022 04:58
Mapping from Indian state codes to Indian state names
{
"AN": "Andaman and Nicobar Islands",
"AP": "Andhra Pradesh",
"AR": "Arunachal Pradesh",
"AS": "Assam",
"BR": "Bihar",
"CG": "Chhattisgarh",
"CH": "Chandigarh",
"CHD": "Chandigarh",
"CT": "Chhattisgarh",
/*
Instructions:
1. Install
$ npm install web3
$ npm install ethereumjs-wallet
$ npm install ethereumjs-util
2. Run
$ node app.js
*/
@Eunoia1729
Eunoia1729 / primes.mysql
Last active December 30, 2021 09:52
Generate prime numbers in SQL till 1000
WITH
RECURSIVE numbers(N) AS (
SELECT 2
UNION ALL
SELECT N + 1 FROM numbers
WHERE N < 1000
)
SELECT F1.N
FROM numbers F1
@Eunoia1729
Eunoia1729 / fibonacci.mysql
Created December 28, 2021 13:01
Generating fibonacci sequence in MySQL
WITH
RECURSIVE fib(n, a, b) AS
(
SELECT 1, 1, 0
UNION ALL
SELECT n + 1, a + b, a
FROM fib
WHERE n < 10
)
SELECT a