Skip to content

Instantly share code, notes, and snippets.

View cicorias's full-sized avatar

Shawn Cicoria cicorias

View GitHub Profile
@cicorias
cicorias / appify
Created April 13, 2017 17:08
Create a mac App from a script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
Note that you cannot rename appified apps. If you want to give your app
a custom name, use the second argument:
`basename "$0"` my-script.sh "My App"
@cicorias
cicorias / gethTestnet.sh
Created April 14, 2017 15:59
quick run of geth
#!/usr/bin/env bash
set -x
COINBASE=0xb43cd96eDF87fB9686fB18A932FF2Aa011A46c37
RPC="--rpc --rpcaddr "0.0.0.0" --rpcapi "admin,debug,eth,miner,net,personal,shh,txpool,web3" --rpccorsdomain "*"
MINE="--mine --minerthreads 1" --etherbase $COINBASE"
VERBOSITY="--verbosity 3"
LOGFILE='2>1 1>geth.log'
nohup geth --networkid 3 --identity shawncicoriadev --fast $RPC $MINE $VERBOSITY $LOGFILE
@cicorias
cicorias / fakedata.py
Created May 3, 2017 23:01
OMS Synthetic Data Generator
#!/usr/bin/env python
import sys
import logging
from time import sleep
import argparse
from web3 import Web3, IPCProvider
@cicorias
cicorias / npm_upgrade.sh
Created May 13, 2017 01:51
upgrading npm packages the right way
#!/bin/sh
set -e
set -x
for package in $(npm -g outdated --parseable --depth=0 | cut -d: -f2)
do
npm -g install "$package"
done
@cicorias
cicorias / filterit.js
Created May 16, 2017 23:14
quick filter in geth
#!/usr/bin/env node
const host = 'http://IP:8545'
const Web3 = require('web3')
const HttpHeaderProvider = require('httpheaderprovider');
//const provider = new HttpHeaderProvider(host);
const provider = new Web3.providers.HttpProvider(host)
const web3 = new Web3(provider);
@cicorias
cicorias / makeLock.sh
Created May 18, 2017 16:37
macOS lock screen 1 line command
# Do our work in the temporary directory that gets cleaned on boot
cd /tmp
# Create the source file
cat > main.m <<END_OF_FILE
#import <objc/runtime.h>
#import <Foundation/Foundation.h>
int main () {
alias docker-rm='docker rm -f $(docker ps -q)'
alias docker-stop='docker stop $(docker ps -q)'
alias docker-rmi='docker rmi -f $(docker images -q)'
alias docker-clean='docker-stop && docker-rm && docker-rmi'
@cicorias
cicorias / events.js
Last active May 20, 2017 20:45
Subscribe to Events
#!/usr/bin/env node
var winston = require('winston');
winston.level = 'debug';
configureLogging();
const ssAbi = require('./app/build/contracts/SimpleStorage.json').abi;
var queue = [];
// const host = 'http://13.64.236.113:8545'
const host = 'http://localhost:8545'
@cicorias
cicorias / static_server.js
Created May 21, 2017 03:26 — forked from amejiarosario/static_server.js
Node.js quick file server (static files over HTTP) using es6+
const http = require('http');
const url = require('url');
const fs = require('fs');
const path = require('path');
const port = process.argv[2] || 9000;
http.createServer(function (req, res) {
console.log(`${req.method} ${req.url}`);
// parse URL
@cicorias
cicorias / azuredeploy.json
Created May 28, 2017 16:18 — forked from christopheranderson/azuredeploy.json
Function App ARM template with MSDeploy
{
"$schema": "http://schemas.management.azure.com/schemas/2015-01-01-preview/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"appName": {
"type": "string",
"metadata": {
"description": "The name of the function app that you wish to create."
}
},