Skip to content

Instantly share code, notes, and snippets.

@mythz
mythz / gist:c82c770cc17f11bb38df
Created January 16, 2015 18:06
Undocumented but useful built-in functions for Swift
Can be extracted from `libswiftCore.dylib` with:
cd `xcode-select -p`/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx
nm -a libswiftCore.dylib | grep "T _swift_"
Output:
00000000001a4fc0 T _swift_ClassMirror_count
00000000001a52a0 T _swift_ClassMirror_quickLookObject
00000000001a5000 T _swift_ClassMirror_subscript
@ehazlett
ehazlett / gist:9241844
Last active February 13, 2018 15:47
OpenShift Origin AWS

OpenShift Origin in AWS

This describes deploying and running OpenShift Origin in Amazon Web Services.

This is based upon the code and installer on 2014-02-26 so YMMV.

We will be using a VPC for deployment in us-east-1 and Route53 for DNS. I will leave the VPC setup as an exercise for the reader.

Prerequisites

  • AWS Account
  • VPC
@davidbradway
davidbradway / setup.md
Last active May 19, 2020 22:00
Set Up Docker On Raspberry Pi Raspbian Stretch Lite
@larsblumberg
larsblumberg / gist:2335c0ba97f805a2b996f1a7c3ac9571
Last active May 28, 2021 16:36
Flash Raspian Lite and set up latest BlueZ for Raspberry Pi 3
Flashing the memory card and creating /ssh file
===============================================
diskutil unmountDisk /dev/disk4
sudo dd bs=1m if=2017-01-11-raspbian-jessie-lite.img of=/dev/rdisk4
touch /Volumes/boot/ssh
diskutil unmountDisk /dev/disk4
SSH to Raspberry Pi
===================
import Darwin
extension Array {
func shuffle() -> Array {
// this will sometimes crash (submitted bug #17127524)
self.sort { _,_ in arc4random_uniform(2) == 1 }
return self
}
mutating func removeAtIndexes( indexes:Int... ) {
indexes.sort(>)
@offlinehacker
offlinehacker / README.rst
Last active January 8, 2022 18:21
Script that learns openvpn hostnames from cert CN filed

ovpn-learnaddress

openvpn learn-address script to manage a hosts-like file

  • intended to allow dnsmasq to resolve openvpn clients
  • written for openwrt (busybox), but should work most anywhere

How it works?

@cesarferreira
cesarferreira / RxJava.md
Last active February 2, 2022 07:28
Party tricks with RxJava, RxAndroid & Retrolambda

View Click

Instead of the verbose setOnClickListener:

RxView.clicks(submitButton).subscribe(o -> log("submit button clicked!"));

Filter even numbers

Observable
    .just(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
@booherbg
booherbg / gist:f812c9145d157d8945b2
Last active February 25, 2022 23:44
Cross compiling a simple go server for windows

How to build Golang windows/arm static binaries from linux

Alternate title: Cross compiling Windows/Darwin/Linux amd64/386/arm all from linux

After fumbling around trying to figure out the go toolchain and cross compilation configuration, I ran across the wiki page on Go's homepage. It's super helpful, and worked out of the box. I'm including the necessary scripts here in case they get changed or lost, and we can help Google find it (since it's the first real source I've found that "Just Worked"). http://code.google.com/p/go-wiki/wiki/WindowsCrossCompiling

@robertmarsal
robertmarsal / README.md
Last active March 20, 2022 02:26 — forked from mtowers/README.md
Google Analytics Real Time Visitors Widget for Dashing with OAuth2 Authentication
@mjambon
mjambon / ocaml_lwt_sample.ml
Last active May 29, 2022 19:59
OCaml/Lwt crash course. Adult supervision recommended.
(*
Interactive approach
--------------------
You can copy-paste code into `utop`, provided you load the lwt.unix
package:
#use "topfind";;
#thread;; (* only needed in the plain `ocaml` toplevel, not in `utop`. *)
#require "lwt.unix";;