Skip to content

Instantly share code, notes, and snippets.

@chill117
chill117 / start_stop_restart.sh
Created July 6, 2014 18:47
A simple bash script for starting/stopping/restarting an application or service.
#!/bin/bash
#
# A simple bash script for starting/stopping/restarting an application or service.
#
start()
{
# Your start application code goes here.
}
@chill117
chill117 / watch.py
Last active August 29, 2015 14:04
Watches for new transactions in the default wallet of Electrum. When a new transaction is received at an address, the full history of that address is printed to the console.
#!/usr/bin/env python
# Place this file in the Electrum scripts directory. Then run from command line, like this: `~/.electrum/scripts/watch.py`.
import sys, time
from electrum import Network, print_json, SimpleConfig, Wallet, WalletStorage
def initialize():
config = SimpleConfig()
@chill117
chill117 / get_address_by_index.py
Last active August 29, 2015 14:04
Get an address by its index from the default wallet in Electrum.
#!/usr/bin/env python
# Place this file in the Electrum scripts directory. Then run from command line, like this: `~/.electrum/scripts/get_address_by_index.py <index>`.
import sys
from electrum import SimpleConfig, Wallet, WalletStorage
try:
index = int(sys.argv[1])
except Exception:
print 'Usage: ' + sys.argv[0] + ' <index>'
@chill117
chill117 / adjust_gap_limit_to_find_address.py
Last active August 29, 2015 14:04
Automatically adjusts the gap limit in the default wallet of Electrum so that the given address is included in the list of addresses.
#!/usr/bin/env python
# Place this file in the Electrum scripts directory. Then run from command line, like this: `~/.electrum/scripts/adjust_gap_limit_to_find_address.py`.
import sys
from electrum import bitcoin, Network, print_json, SimpleConfig, Wallet, WalletStorage
try:
addr = sys.argv[1]
except Exception:
print 'Usage: ' + sys.argv[0] + ' <bitcoin_address>'
@chill117
chill117 / jquery.center.js
Last active December 17, 2015 12:19
Extend jQuery with the .center() method. Allows you to easily center element(s) within a container (or the viewport).
/*
|----------------------------------------------------------------
| Description
|----------------------------------------------------------------
Extend jQuery with the .center() method. Allows you to easily
center element(s) within a container (or the viewport).
@chill117
chill117 / cache_buster_helper.php
Created July 11, 2013 00:10
Force client browser to download fresh CSS/JS file whenever the file is modified on the server.
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
|----------------------------------------------------------------
| Description
|----------------------------------------------------------------
Force client browser to download fresh CSS/JS file whenever
the file is modified on the server.
@chill117
chill117 / shell_helper.php
Created July 11, 2013 00:36
Provides the command_exists() method, which will test to see if the given shell command exists.
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
|----------------------------------------------------------------
| Description
|----------------------------------------------------------------
Provides the command_exists() method, which will test to see if
the given shell command exists.
@chill117
chill117 / time_format_helper.php
Last active December 19, 2015 14:48
Quick, handy time format functions. Useful for GUIs or whenever a human-friendly time format is preferred over a timestamp or machine-readable date-time format.
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
|----------------------------------------------------------------
| Description
|----------------------------------------------------------------
Quick, handy time format functions. Useful for GUIs or whenever
a human-friendly time format is preferred over a timestamp or
@chill117
chill117 / roman_numerals_helper.php
Created July 11, 2013 00:31
Converts an Arabic Numeral to Roman Numeral. Works for 1 through 4999.
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
|----------------------------------------------------------------
| Description
|----------------------------------------------------------------
Converts an Arabic Numeral to Roman Numeral.
@chill117
chill117 / ExtendHttpSupport.php
Last active December 20, 2015 23:38
Adds support for PUT verb in CodeIgniter; populates PHP's $_POST data super global with data for PUT requests.
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/*
Description:
Adds support for PUT verb in CodeIgniter; populates PHP's $_POST data
super global with data for PUT requests.