Skip to content

Instantly share code, notes, and snippets.

View pgebheim's full-sized avatar

Paul Gebheim pgebheim

  • San Francisco, CA
View GitHub Profile
@pgebheim
pgebheim / vim.rb
Created May 25, 2011 09:12 — forked from lxneng/vim.rb
Vim formula for Homebrew
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
url 'ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2'
head 'https://vim.googlecode.com/hg/'
sha256 '5c5d5d6e07f1bbc49b6fe3906ff8a7e39b049928b68195b38e3e3d347100221d'
version '7.3.189'
def features; %w(tiny small normal big huge) end
@pgebheim
pgebheim / SafeSet.m
Created September 26, 2012 04:29 — forked from ridiculousfish/SafeSet.m
A thread safe set written in Objective-C
#import <Foundation/Foundation.h>
@interface SafeSet : NSObject {
NSMutableSet *set;
dispatch_queue_t queue;
}
@end
@implementation SafeSet

Keybase proof

I hereby claim:

  • I am pgebheim on github.
  • I am pgebheim (https://keybase.io/pgebheim) on keybase.
  • I have a public key ASBWyp0zgRj79M-LUh-RqwtQPyaQ-oEp0xeODBAH0W8PHQo

To claim this, I am signing this object:

(function() {
var loadScript = function(s) {
var script = document.createElement('script');
script.src = s;
document.body.appendChild(script);
};
var simulatedClick = function(target, options) {
var event = target.ownerDocument.createEvent('MouseEvents'),
options = options || {},
@pgebheim
pgebheim / discord-hack-loader.js
Last active November 9, 2017 18:43
Paste this into your Discord dev console to get reaction hotkeys! ctrl+shift+\
(function(){
var el = document.createElement('script');
el.src = "https://cdn.rawgit.com/pgebheim/f77dd4a56fe2c18c4309492a081a6201/raw/fb9feb96a101e28b4e83bdf279fa62022eb982b9/discord-reaction-hotkey.js";
document.body.append(el);
el = document.createElement('script');
el.src = "https://cdn.rawgit.com/pgebheim/68f408aa76ad07e164a3dab4b75d5ac1/raw/556c2e185fee360e758f3e520b3b5f271c5c8ddc/discord-theme-fix-dark.js";
document.body.append(el);
})();
(function() {
var el = document.createElement('style');
el.innerText = " \
.theme-dark .message-group .comment .markup { color: hsla(0,0%,100%,1); } \
.theme-light .message-group .comment .markup { color: black !important } \
.message-group { border-bottom: none; padding: 10px 0; } \
";
document.body.appendChild(el);
})();
@pgebheim
pgebheim / ethers-bindings.ts
Created October 24, 2018 18:57
Ethers.js binding for contract interfaces
import { Dependencies, AbiFunction, AbiParameter, Transaction } from './generated/liquid-long'
import { keccak256, toUtf8Bytes, BigNumber, AbiCoder } from 'ethers/utils'
import { TransactionResponse, TransactionRequest } from 'ethers/providers';
export interface Provider {
listAccounts(): Promise<Array<string>>
call(transaction: TransactionRequest): Promise<string>
}
export interface Signer {
@pgebheim
pgebheim / ethers-bindings.ts
Last active October 24, 2018 18:57
Ethers.js binding for contract interfaces
// Bindings for interace generated by:
// https://github.com/Zoltu/solidity-typescript-generator
import { Dependencies, AbiFunction, AbiParameter, Transaction } from './generated/liquid-long'
import { keccak256, toUtf8Bytes, BigNumber, AbiCoder } from 'ethers/utils'
import { TransactionResponse, TransactionRequest } from 'ethers/providers';
export interface Provider {
listAccounts(): Promise<Array<string>>
call(transaction: TransactionRequest): Promise<string>
contract HasAnOwner {
address owner;
function useSuperPowers(){
if (msg.sender != owner) { throw; }
// do something only the owner should be allowed to do
}
}
contract NumberGiver {
function giveMeIt() {
return 10;
}
}