Skip to content

Instantly share code, notes, and snippets.


Garrett T film42

View GitHub Profile
eduncan911 / go-build-all
Last active Dec 16, 2020
Go Cross-Compile Script
View go-build-all
# GoLang cross-compile snippet for Go 1.6+ based loosely on Dave Chaney's cross-compile script:
# To use:
# $ cd ~/path-to/my-awesome-project
# $ go-build-all
rohanag12 /
Last active Jan 15, 2021
Create an SslSocketFactory using PEM encrypted certificate files
* Utility class to read encrypted PEM files and generate a
* SSL Socket Factory based on the provided certificates.
* The original code is by Sharon Asher (link below). I have modified
* it to use a newer version of the BouncyCastle Library (v1.52)
* Reference -"
import org.bouncycastle.cert.X509CertificateHolder;
l8nite / gist:18e1aa073d4c758bf440
Created Nov 20, 2014
Quick and dirty way to exclude files from a gemspec
View gist:18e1aa073d4c758bf440
git_tracked_files = `git ls-files -z`.split("\x0")
gem_ignored_files = `git ls-files -i -X .gemignore -z`.split("\x0")
spec.files = git_tracked_files - gem_ignored_files
noprompt / slurp.clj
Created Feb 19, 2014
How to use slurp from ClojureScript
View slurp.clj
(ns foo.core
(:refer-clojure :exclude [slurp]))
(defmacro slurp [file]
(clojure.core/slurp file))
;; In CLJS
(ns bar.core
(:require [foo.core :include-macros true :refer [slurp]]))
View Try.scala
private def getForecast:Try[JsValue] = {
val ts = date.getTime / 1000
val u = {
if (date == new Date()) new URL(s"$apiKey/$lat,$lon?units=$units")
else new URL(s"$apiKey/$lat,$lon,$ts?units=$units")
val s = new Scanner(u.openStream(), "UTF-8")
Kimundi /
Last active Jan 3, 2021
A light comparison between Rust and Java generics and type system features.


If you are familiar with Java's generics, and are coming to Rust, you might be lead to assume that its generics are working the same way.

However, due to the different type systems, and different implementation details, there are quite a few differences between generic code in both languages.

This document tries to give a short summary about those differences:

Core functionality


danneu /
Last active Jan 13, 2021
Google I/O 2012 - Go Concurrency Patterns ported to Clojure Video:
philipbjorge /
Last active Dec 15, 2015
Empty Set Literal Notation for Python 2.7 [BUGFIX] Replaced minus sign with @ symbol. With the minus sign, Python couldn't handle any set notation that started with a negative (e.g. {-3} would fail).
# Grammar for Python
# Note: Changing the grammar specified in this file will most likely
# require corresponding changes in the parser module
# (../Modules/parsermodule.c). If you can't make the changes to
# that module yourself, please co-ordinate the required changes
# with someone who can; ask around on python-dev for help. Fred
# Drake <> will probably be listening there.
# NOTE WELL: You should also follow all the steps listed in PEP 306,
View gist:3217582
;; based on core.logic 0.8-alpha2 or core.logic master branch
(ns sudoku
(:refer-clojure :exclude [==])
(:use clojure.core.logic))
(defn get-square [rows x y]
(for [x (range x (+ x 3))
y (range y (+ y 3))]
(get-in rows [x y])))
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:


start new with session name:

tmux new -s myname
You can’t perform that action at this time.