Skip to content

Instantly share code, notes, and snippets.

View longngn's full-sized avatar
🎯
Focusing

Long Nguyen longngn

🎯
Focusing
View GitHub Profile
@longngn
longngn / vscode-competitive-programming.md
Created August 1, 2017 06:47
Configure VSCode for competitive programming

What is competitive programming?

Sites like CodeForces, TopCoder, HackerRank, CodeChef,... ACM-ICPC, Olympiad in Informatics (for high school students), Google Code Jam, Facebook Hacker Cup,... Anything involves solving short problems in 2-5 hours by code using algorithms and data structures.

Requirements

  • High coding speed.
  • One-click compile and run for one source file.
  • Automatic linting
// 1. Put this file into the folder "bits"
// 2. Put this line into "bits/stdc++.h": #include "cp-debug.cpp"
// 3. Now you can cout << STL !! Modify this code as to suit your style
// Example: https://imgur.com/a/kulaD
using namespace std;
template <class T1, class T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &a) {
return os << '(' << a.first << ", " << a.second << ')';
}
(() => {
var MD5 = function(d){result = M(V(Y(X(d),8*d.length)));return result.toLowerCase()};function M(d){for(var _,m="0123456789ABCDEF",f="",r=0;r<d.length;r++)_=d.charCodeAt(r),f+=m.charAt(_>>>4&15)+m.charAt(15&_);return f}function X(d){for(var _=Array(d.length>>2),m=0;m<_.length;m++)_[m]=0;for(m=0;m<8*d.length;m+=8)_[m>>5]|=(255&d.charCodeAt(m/8))<<m%32;return _}function V(d){for(var _="",m=0;m<32*d.length;m+=8)_+=String.fromCharCode(d[m>>5]>>>m%32&255);return _}function Y(d,_){d[_>>5]|=128<<_%32,d[14+(_+64>>>9<<4)]=_;for(var m=1732584193,f=-271733879,r=-1732584194,i=271733878,n=0;n<d.length;n+=16){var h=m,t=f,g=r,e=i;f=md5_ii(f=md5_ii(f=md5_ii(f=md5_ii(f=md5_hh(f=md5_hh(f=md5_hh(f=md5_hh(f=md5_gg(f=md5_gg(f=md5_gg(f=md5_gg(f=md5_ff(f=md5_ff(f=md5_ff(f=md5_ff(f,r=md5_ff(r,i=md5_ff(i,m=md5_ff(m,f,r,i,d[n+0],7,-680876936),f,r,d[n+1],12,-389564586),m,f,d[n+2],17,606105819),i,m,d[n+3],22,-1044525330),r=md5_ff(r,i=md5_ff(i,m=md5_ff(m,f,r,i,d[n+4],7,-176418897),f,r,d[n+5],12,1200080426),m,f,d[n+6],17,-1473231
@SmaugPool
SmaugPool / cardano-cli-completion.md
Last active November 29, 2023 11:57
cardano-cli Bash auto-completion

To enable cardano-cli and cardano-node bash auto-completion for the current shell:

source <(cardano-cli --bash-completion-script cardano-cli)
source <(cardano-cli --bash-completion-script cardano-node)

To enable it for all future sessions:

@rcmorano
rcmorano / use-daedalus-bundled-cardano-cli.sh
Last active March 14, 2021 19:26
use-daedalus-bundled-cardano-cli (macos)
CARDANO_NODE_SOCKET_PATH=$(ps ax | grep -v grep | grep cardano-node.run.*socket | sed -e 's|.*\(--socket-path\) \(.*cardano-node.socket\) --.*|\2|g')
PATH=${PATH}:"/Applications/Daedalus Mainnet.app/Contents/MacOS"
cardano-cli get-tip --mainnet