Skip to content

Instantly share code, notes, and snippets.

@wallrat
wallrat / six-sdk-memoized.js
Last active February 17, 2017 09:23
Wrapping the six-sdk connect() to memoize sessions
import sdk from 'six-sdk'
let cachedSession
let cachedToken
export default {
connect: (token) => {
if (token === cachedToken) {
return cachedSession
}
package main
import (
"fmt"
"log"
"net/http"
)
func main() {
@wallrat
wallrat / hitch.rb
Created October 29, 2016 17:58
Homebrew brew formula for Varnish'es Hitch TLS Proxy Server
class Hitch < Formula
desc "A scalable TLS proxy by Varnish Software"
homepage "https://github.com/varnish/hitch"
url "https://github.com/varnish/hitch/archive/hitch-1.3.0-beta2.tar.gz"
sha256 "fbec6197a77c54f23e941cf0fcecbb8f6c24086ebe2c45467d30b330a370fe90"
head "https://github.com/varnish/hitch.git"
depends_on "automake" => :build
depends_on "autoconf" => :build
depends_on "pkg-config" => :build
@wallrat
wallrat / LoadTexture.cs
Created May 2, 2016 06:09
Load a unity texture from internet
private IEnumerator FetchSprite(string imageURL)
{
//create a www instance
WWW www = new WWW(imageURL);
//build a new texture
Texture2D tex = new Texture2D(1, 1, TextureFormat.ARGB32, false);
//set filter mode to point (pixel art)
tex.filterMode = FilterMode.Point;
package scratch;
import org.openjdk.jmh.annotations.*;
import org.openjdk.jmh.infra.Blackhole;
import org.openjdk.jmh.runner.Runner;
import org.openjdk.jmh.runner.RunnerException;
import org.openjdk.jmh.runner.options.Options;
import org.openjdk.jmh.runner.options.OptionsBuilder;
import java.util.UUID;
@wallrat
wallrat / config
Created March 8, 2015 18:02
i3wm config
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!

Keybase proof

I hereby claim:

  • I am wallrat on github.
  • I am wallrat (https://keybase.io/wallrat) on keybase.
  • I have a public key whose fingerprint is C1EC 5563 B6F2 2F1F 1A21 2D05 F8B4 8663 B812 62A2

To claim this, I am signing this object:

@wallrat
wallrat / jsbin.ENILAqEY.coffee
Last active January 2, 2016 14:39 — forked from anonymous/jsbin.ENILAqEY.coffee
Experimental glue code for using React components in AngularJS apps.
reactModule = angular.module 'react',[]
#
# Usage <div react-attach={{React class}} react-prop-{{React prop}}={{angular scope expression}}* />
#
reactModule.directive 'reactAttach', ->
return {
restrict: 'A'
link: (scope,element,attrs) ->
# get React component construnctor fn
@wallrat
wallrat / React-dashboard.markdown
Created January 7, 2014 15:03
A Pen by Andreas Bielk.
@wallrat
wallrat / proxy.go
Created July 6, 2012 11:25
Simple GO TCP proxy
package main
import (
"net"
"fmt"
"io"
"os"
)
func main() {
if len(os.Args) != 3 {
fatal("usage: netfwd local remote")