Skip to content

Instantly share code, notes, and snippets.

# Tests for antialiasing a high-frequency image in various ways
# Nathan Reed, July 2014
# Written for Python 3.4; requires numpy and Pillow to be installed
import concurrent.futures
import math
import multiprocessing
import numpy as np
import optparse
import random
/*
Copyright 2011 Martin Hawksey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
on searchReplace(theText, SearchString, ReplaceString)
set OldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to SearchString
set newText to text items of theText
set AppleScript's text item delimiters to ReplaceString
set newText to newText as text
set AppleScript's text item delimiters to OldDelims
return newText
end searchReplace

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@potterdai
potterdai / 01.README.md
Created April 27, 2017 03:39 — forked from mmmries/01.README.md
Load Test Phoenix Presence

Phoenix Nodes

First I created 3 droplets on digital ocean with 4-cores and 8GB of RAM. Login as root to each and run:

sysctl -w fs.file-max=12000500
sysctl -w fs.nr_open=20000500
ulimit -n 4000000
sysctl -w net.ipv4.tcp_mem='10000000 10000000 10000000'
@potterdai
potterdai / UISortBehavior.cs
Created August 25, 2017 23:33 — forked from dogles/UISortBehavior.cs
MonoBehaviour for sorting Renderers against NGUI widgets.
using UnityEngine;
public class UISortBehavior : MonoBehaviour
{
public UIWidget widgetInFrontOfMe;
[System.NonSerialized]
Renderer m_renderer;
void Awake() {
@potterdai
potterdai / playstore.go
Created August 28, 2017 09:00 — forked from mltucker/playstore.go
Standalone (Play Store only) go-iap for GAE
package yourgaeproject
// go-iap doesn't work for GAE since we need to use urlfetch
//
// Copy this source file to your GAE to your project.
//
// The API is mostly the same as go-iap. I prefixed some stuff since this file lives within my GAE project's package.
// client, err := PlaystoreNew(ctx, jsonKey)
//
// purchase, err := client.VerifyProduct("com.you.yourapp", productId, purchaseToken)