Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Subhod I subhodi

🎯
Focusing
  • Goa
View GitHub Profile
@subhodi
subhodi / QuickSort.sol
Created Dec 14, 2017
Quick sort in Solidity for Ethereum network
View QuickSort.sol
pragma solidity ^0.4.18;
contract QuickSort {
function sort(uint[] data) public constant returns(uint[]) {
quickSort(data, int(0), int(data.length - 1));
return data;
}
function quickSort(uint[] memory arr, int left, int right) internal{
@subhodi
subhodi / short-pwd.sh
Created Feb 19, 2019
Shorten-the-current-directory-path-shown-on-terminal
View short-pwd.sh
if [ "$color_prompt" = yes ]; then
# PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\]\$ '
else
# PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
PS1='\u@\h: \W:\$'
fi
@subhodi
subhodi / beautify-hs.sh
Last active Feb 5, 2019
run Stylish-haskell
View beautify-hs.sh
#!/bin/bash
sudo apt-get -y install stylish-haskell
echo "\n Current working directory $PWD/src \n"
FILE="$(find ./src/ -name '*.hs')"
for file in $FILE
do
echo "Processing "$file
echo "$(stylish-haskell $file)" > $file
done
echo "done"
@subhodi
subhodi / git-upstream-sync.md
Last active Nov 22, 2018
Pull update from original repo
View git-upstream-sync.md
@subhodi
subhodi / cwd.sh
Last active Aug 23, 2018
Current working directory
View cwd.sh
echo 'alias cwd="cd '$PWD'"' >> ~/.bashrc
source ~/.bashrc
View relay.log
eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NksifQ.eyJpYXQiOjE1MjY4OTMxNjYsImlzcyI6ImRpZDp1cG9ydDpCWDE4Sk1lVER4SlpHWmJXeEtqQUplVjdtcVFCR3dMQk5ZMlYiLCJhdWQiOiJCWDE4Sk1lVER4SlpHWmJXeEtqQUplVjdtcVFCR3dMQk5ZMlYiLCJ0eXBlIjoiY2hhaW5Qcm92Iiwic3ViIjoiQlgxOEpNZVREeEpaR1piV3hLakFKZVY3bXFRQkd3TEJOWTJWIiwiZGFkIjoiMHg4Y2E5Nzg5MTIwNjA1YzFmMzM2NGU4NTQ1NmYzZTYwMmU1NTI1YTAzIiwiY3RsIjoiMHhjNzliYTMwNzQ0ODZmZGVjNmFhMzczYTg5YWQ0YWYzMzZmNDhjMzZlIn0.ayeItyqMHfIZzBeDITQPrVJizrUX2TCBi4dA-kxsvfJI4Ty66Ba-pb1MEzaEcpXx_X-J-MQHzz-gc2kuq7k5Fw
@subhodi
subhodi / ethereum-seeder.js
Created May 11, 2018
Web3 quick account seeder: $node
View ethereum-seeder.js
Web3=require('web3')
web3= new Web3(new Web3.providers.HttpProvider("http://127.0.0.1:7545"))
web3.isConnected()
web3.eth.sendTransaction({from:web3.eth.accounts[0],to:"0x4872f45d4c5ee0ddf7e0b5a70fd2ddcce0bd0f63",value:99999999999})
View quorum-issues-316-contract.sol
pragma solidity ^0.4.18;
contract demo {
mapping(uint => uint) public map;
event Finished();
function seedMap(uint _start, uint _end) public {
for(uint i=_start;i<_end;i++) {
map[i] = i;
@subhodi
subhodi / vscode.md
Last active Apr 9, 2018
VS code shortcuts
View vscode.md
Shortcut Task
shift+alt+o
@subhodi
subhodi / keybindings.json
Last active Mar 28, 2018
NODEJS console.log key bindings for vscode
View keybindings.json
// Place your key bindings in this file to overwrite the defaults
// 1. Ctrl+q to insert console.log()
// 2. Ctrl+shift+q to insert console.log("")
// 3. Ctrl+shift+y to insert console.log with yellow text config
// 4. ctlr=shift+i to insert License using fileHeader externsion
[
{
"key": "ctrl+q",
"command": "editor.action.insertSnippet",
"when": "editorTextFocus",