Skip to content

Instantly share code, notes, and snippets.

@swuecho
swuecho / README.md
Created October 28, 2015 17:37 — forked from estebistec/README.md
This minimal setup allows you to run nginx using the current folder as the doc-root. NOTE: python's simplehttpserver may be good enough for you. This is just a nice simple nginx setup.
  1. Get all of these files into the target folder
  2. Run the following commands:
chmod +x *.sh
./nginx-start.sh
language filename contributors
D
learnd.d
/*TODO:
	* static variables and CTFE (also TLS)
	* delegates, function/delegate literals
@swuecho
swuecho / Tree.scala
Created July 28, 2016 01:36 — forked from dholbrook/Tree.scala
Scala binary tree
/**
* D Holbrook
*
* Code Club: PO1
*
* (*) Define a binary tree data structure and related fundamental operations.
*
* Use whichever language features are the best fit (this will depend on the language you have selected). The following operations should be supported:
*
* Constructors
@swuecho
swuecho / tar_test.c
Created November 19, 2016 05:16 — forked from danikin/tar_test.c
Tarantool Quick Test
// Tarantool quick test
// Copyright, Dennis Anikin 2016
//
// Quick disclaimer:
//
// This test shows 500K-1000K transactions per second on one CPU core
// and 600K-1600K queries per second on one CPU core.
//
// Based on the $6.57 per-month-price for the AWS t2.micro instance we can afford the tremendous number of 630bln queries for just $1
//
@swuecho
swuecho / Trie.js
Created November 21, 2016 00:19 — forked from tpae/Trie.js
Trie.js - super simple JavaScript implementation
// Trie.js - super simple JS implementation
// https://en.wikipedia.org/wiki/Trie
// -----------------------------------------
// we start with the TrieNode
function TrieNode(key) {
// the "key" value will be the character in sequence
this.key = key;
@swuecho
swuecho / gist:fbebd122af13a15505948482768eda56
Created December 3, 2016 07:23 — forked from NikolayS/file_fdw__csv.sql
Postgres: CSV file as a table using FDW
-- Installs "file_fdw" extension and creates foreign table to work with data from CSV file.
-- See also the comment below which helps to automate the process for Google Spreadsheets
-- Another option would be using Multicorn for Google Spreadsheets, but it requires additional steps
-- (see https://wiki.postgresql.org/wiki/Foreign_data_wrappers).
CREATE EXTENSION file_fdw;
CREATE SERVER import FOREIGN DATA WRAPPER file_fdw;
CREATE FOREIGN TABLE table1_import (
col1 text,
col2 text,
@swuecho
swuecho / barcodes.csv
Created December 15, 2016 01:35 — forked from audy/barcodes.csv
Demultiplex Ion Torrent Reads
1 CTAAGGTAA
2 TAAGGAGAA
3 AAGAGGATT
4 TACCAAGAT
5 CAGAAGGAA
6 CTGCAAGTT
7 TTCGTGATT
8 TTCCGATAA
9 TGAGCGGAA
10 CTGACCGAA
@swuecho
swuecho / playground.rs
Created December 21, 2016 17:56 — forked from anonymous/playground.rs
Shared via Rust Playground
struct Point {
x: i32,
y: i32,
}
fn takes_point(Point {x, y}: Point) {
println!("({}, {})", x, y);
}
fn main() {

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

@swuecho
swuecho / gist:c0e9394b183edf120362390b6f4b808f
Created March 9, 2017 00:56 — forked from aidanhs/gist:5ac9088ca0f6bdd4a370
Rust binary tree worked example

% Let's build a binary tree!

Let's build a binary tree of strings in Rust. To recap, each node in a binary tree:

  1. must have a value
  2. may or may not have left and/or right children

So we can describe a single node like this: