Skip to content

Instantly share code, notes, and snippets.

@trapp
trapp / delete-svn.sh
Created August 10, 2011 12:23
Delete .svn folders recursively
find . -type d -name .svn -exec rm -Rf {} \;
@trapp
trapp / vi-replace
Created August 10, 2011 12:25
Vi replace guide
First occurrence on current line: :s/OLD/NEW
All occurrences on current line: :s/OLD/NEW/g
Between two lines #,#: :#,#s/OLD/NEW/g
Every occurrence in file: :%s/OLD/NEW/g
@trapp
trapp / mysql-grant-remote-access.sql
Created December 12, 2012 10:27
mysql grant remote access
-- Don't forget to replace »password« with a strong password.
create user 'username'@'localhost' identified by 'password';
grant all privileges on *.* to 'username'@'yourip' IDENTIFIED BY 'password' with grant option;
flush privileges;
@trapp
trapp / navlist-divider.css
Created July 10, 2013 10:02
Vertical navigation divider CSS only
.nav-list .nav-item:after {
content: "";
position: absolute;
right: 0;
top: 6px;
height: 12px;
width: 1px;
background-color: #e2e2e2;
border-bottom: 1px solid #fff;
}

Keybase proof

I hereby claim:

  • I am trapp on github.
  • I am timon (https://keybase.io/timon) on keybase.
  • I have a public key whose fingerprint is 2E05 6444 BDAB 4136 CDF2 8302 AB92 AC32 C536 0BD7

To claim this, I am signing this object:

Verifying that +timon is my Bitcoin username. You can send me #bitcoin here: https://onename.io/timon
import "owned";
contract DepositTracker is owned
{
event Deposit(address indexed from, uint value);
event Transfer(address indexed to, uint value);
function () {
Deposit(msg.sender, msg.value);
}
import "owned";
contract TokenProxy is owned {
modifier noEther() {if (msg.value > 0) throw; _}
event TokenTransfer(address indexed tokenAddress, address indexed to, uint256 value);
function () noEther {
}
function transferToken(address tokenAddress, address to, uint256 value) onlyowner noEther {
@trapp
trapp / amionthefork.sol
Last active March 23, 2017 05:39
Ethereum Fork Oracle - Am I on the Fork?
contract AmIOnTheFork {
// Tracks whether hard fork is effective on this chain. True means the fork is passed, false it hasn't.
bool public forked = false;
// Dark DAO address
address constant darkDAO = 0x304a554a310c7e546dfe434669c62820b7d83490;
// This function should be called between block 1920000 and 1921200.
// Approximately between 2016-07-20 12:00:00 UTC and 2016-07-20 17:00:00 UTC.
// After that the status will be locked in.
@trapp
trapp / replaysafeproxy.sol
Last active July 19, 2016 22:07
ReplaySafeProxy
contract ReplaySafeProxy {
// Tracks if the contract should work on this chain or not.
bool enabled = false;
// Fork oracle to use
AmIOnTheFork amIOnTheFork = AmIOnTheFork(0x2bd2326c993dfaef84f696526064ff22eba5b362);
address target;
// _target is the address this contract will forward all funds to.
// forked specifies if it should work on ETH (true) or ETHC (false)
// Any value transfer to this contract will fail on the other network.