Skip to content

Instantly share code, notes, and snippets.

View AlexanderC's full-sized avatar
💭
I might be slow to respond.

Alex Cryp AlexanderC

💭
I might be slow to respond.
View GitHub Profile
@AlexanderC
AlexanderC / gist:03541f4cf68d316ca4b4f603dc55f36b
Created September 28, 2020 07:20
Docker: stop container and purge data and images.
alias docker-purge='(docker stop $(docker ps -aq) || echo "Skipping...") && (docker rm $(docker ps -aq) || echo "Skipping...") && (docker rmi -f $(docker images -q) || echo "Skipping...")'
@AlexanderC
AlexanderC / geth-jsonrpc-authorizzation-proxy.js
Last active November 12, 2020 09:55
Stupid JSONRPC proxy
/* file:./proxy.json
{
"servers": [
{
"token": "abc",
"port": "8007",
"target": "http://localhost:8008"
},
{
"token": "def",
@AlexanderC
AlexanderC / bc_integrity.sh
Last active November 14, 2019 10:30
Ethereum/geth synchronization check
#!/bin/bash
# Using crontab command:
# */10 * * * * $HOME/bc_integrity.sh ropsten 30311 200 'http://slackhook' >> $HOME/bc_integrity.log 2>&1
# You might want to cleanup log file, use crontab command:
# 0 8 * * * echo "$(tail -10000 $HOME/bc_integrity.log)" > $HOME/bc_integrity.log
network=$1 # ethereum network in letters (mainnet, ropsten, rinkeby etc.)
port=$2 # local geth port
threshold=$3 # number of blocks behind
slackHook=$4 # slack hook url
@AlexanderC
AlexanderC / crypto.csv
Created January 15, 2018 15:42
Crypto listing
We can't make this file beautiful and searchable because it's too large.
24h_volume_usd,add_date,algorithm,announcement,available_supply,cc_id,chat,chat_2,coin_type,explorer,explorer_2,explorer_3,facebook,id,image_url,last_updated,market_cap_usd,max_supply,message_board,message_board_2,mining_type,name,percent_change_1h,percent_change_24h,percent_change_7d,price_btc,price_usd,rank,slug,source_code,source_code_2,source_code_3,source_code_4,start_date,symbol,total_supply,twitter,website,website_2
24303.0,2014-01-13T22:00:00.000Z,Scrypt,https://bitcointalk.org/index.php?topic=1502028,42.0,4321,https://kiwiirc.com/client/chat.freenode.net/##42coin,,coin,https://chainz.cryptoid.info/42/,https://prohashing.com/explorer/42/,,,42-coin,https://www.cryptocompare.com/media/12318415/42.png,1515593641,2152302,42,,,PoW/PoS,42-coin,5.96,-0.7,4.72,3.71,51245.34,680,42-coin,https://github.com/42-coin/42,,,,2014-04-30T21:00:00.000Z,42,41.99997274,@42newchain,https://42-coin.org/,
7873.7,2017-07-24T21:00:00.000Z,,https://bitcointalk.org/index.php?topic=1992952.0,300.0,,,,token,https://etherscan.io/t
@AlexanderC
AlexanderC / moldovan_emojis.sh
Last active April 20, 2017 08:10
Dump Moldovan emojis from https://www.pinterest.com/fruitware/moldavian-emoji/ in a Slack compatible format
#!/usr/bin/env bash
_emoji_dir="$1"
_tmp_dir=$(mktemp -d)
_suffix=".emoji.png"
_script="_emoji.js"
_url="https://www.pinterest.com/fruitware/moldavian-emoji/"
_lib="pinterest-api"
die()
@AlexanderC
AlexanderC / changelog.sh
Created October 26, 2015 13:40
Generate markdown changelog using a github repo
#!/usr/bin/env bash
path=$(cd $(dirname $0); pwd -P)
### Your changes here
CHANGELOG_PATH="$path/../changelog"
LATEST_CHANGELOG_PATH="$path/../CHANGELOG.md"
### End
LAST_MODIFIED=$1
@AlexanderC
AlexanderC / prototype.php
Last active August 29, 2015 14:11
Consolator gist example
$name = $i->get('name', 'Anonymous');
$o->writeln("/f[green]Your name is /f[blink+inverted]%s/!f", [$name]);
@AlexanderC
AlexanderC / deploy.sh
Last active August 29, 2015 14:08
DEEP(symfony2) deploy script
#!/bin/bash
TRUE=1
FALSE=0
path=$(cd $(dirname $0); pwd -P)
is_sudoer=$(sudo -n uptime 2>&1 | grep "load" | wc -l | tr -d ' ')
api_version="v1"
env="prod"
<?php
/**
* @author AlexanderC <self@alexanderc.me>
*/
namespace Life;
class Mood extends Life
{
@AlexanderC
AlexanderC / _.php
Last active December 25, 2015 02:19
Hardcore USSR Framework...
<?php
class ☭ {
protected $☭;
public function __call($n, $v)
{
$this->☭ or ($this->☭ = (object)[]);
@$this->☭->{$n} or ($this->☭->{$n} = []);
$this->☭->{$n}[trim(mb_substr($v[0], 0, mb_strpos($v[0], "\n")))] = create_function(