Skip to content

Instantly share code, notes, and snippets.

View buntine's full-sized avatar
💭
Gringo Starr

Andrew Buntine buntine

💭
Gringo Starr
View GitHub Profile
Making directory audio
Compile audio/audio.c -> audio/audio.o
Compile audio/source.c -> audio/source.o
Compile audio/staticbuffer.c -> audio/staticbuffer.o
Compile audio/staticsource.c -> audio/staticsource.o
Compile audio/streamsource.c -> audio/streamsource.o
Compile audio/vorbis_decoder.c -> audio/vorbis_decoder.o
Making directory filesystem
Compile filesystem/filesystem.c -> filesystem/filesystem.o
Making directory graphics
@buntine
buntine / Building SSH Key management tool with Elixir.md
Last active November 20, 2015 03:31 — forked from jayzz55/Building SSH Key management tool with Elixir.md
Building SSH Key management tool with Elixir

Building SSH Key management tool with Elixir

Sipping the Elixir

After being inspired by David's talk on Elixir at Hardhat, we decided to try and build our own SSH public key management tool PubKeys in Elixir. We're delighted to report back that Elixir is amazing and we've released the source code to the community at Github.

Things we love about Elixir:

  • Writing code in a functional style encourages us to break the code into small chunks of functions.
  • Through the use of function composition operator |>, this makes the code much more readable, and elegant.
  • Pattern matching is great.
abstract class Building {
constructor(public stories: number, public size: number) {
}
public height(): number {
return this.stories * this.size;
}
}
class Hardhat extends Building {
namespace Structure {
export type TabState = "impact" | "timeline" | "geography";
export type OpState = "and" | "or";
export interface AppState {
tab?: TabState,
op: OpState,
tags: Array<string>,
}
}
namespace Structure {
export interface Tab {
preload(callback: () => void): void;
execute(): void;
build(set: Array<Structure.Person>): boolean;
built(): boolean;
}
}
class Impact implements Structure.Tab {
interface Lengthwise {
length: number;
}
function logger<T extends Lengthwise>(arg: T): void {
console.log(arg.length);
}
logger([1,2,3]);
logger({length: 20});
function chunks(lst, size, step=1) {
function generate(from, to) {
if (from.length < step) {
return to.concat(from)
}
return generate(from.slice(step, from.length),
to.concat([from.slice(0, size)]))
}
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCwd7CvS2cMaqII2apLlUweBPWM+ExTklNfLpA+Jr672u0fUgvuRfr4ZEMa0YT1rasXpWRTE1TGnJ+T4k20zpFtmNLFGlXWkJVo0j0NagFndLuN/fSPXRQS1u6chd5hVNTocsnRCLvQYQ7R7XBIv1rSa02M3zKj1LOKlGLIzAPiPstpfFgdOksgA3lddcdP25YnHNGbd4KM7otymACnHqamWyz/DKpnBm6J0R1CZq2J4imjE44qDV636Ol7OI95D0TTns0j29vOqP2flz/vig1Ue0EMTBm87Rk0GQYN5ZCiru2gCEpXjZMFx23FfJLv2kpw5nVNNVv6ALLmog2ifCktbh9caUgf86uUhEDoyyIsdNF48EzedLVzXdhXLXO2W3sLGI+7oVh/aQuEIzv2AqvVlKwWGXkqCBIt3hdXzqwTIrrMZIqpdDyH8wZWy8wrU8j+oB1mp+pOeguwN8KFx4ldtE4I0BRBMShltGduzwTnJTIq5n09AsxI4l5MYHpr7v0cACXexQMHqSg+MOmG33qfHFEPdwBgjO36bLRrAhK2VMytK4CDjfbWf2jTyerSzla2YhnR60PMNUTW1nBUALsFdnjpShPoMJMlU7OCXa/86Y0Xcchm7JdAq7Posv4Jwz2Q5XcHBoP+gsfOtYMbht37LaRayOX78f8b6Sm/Ya4Ezw== perunwit@perunwit
# Please take the time to finish this file as described in
# https://sourceforge.net/p/lirc-remotes/wiki/Checklist/
# and make it available to others by sending it to
# <[email protected]>
#
# This config file was automatically generated
# using lirc-0.9.4d(uirt2_raw) on Mon Jul 24 17:43:09 2017
# Command line used: -f -d /dev/ttyUSB0 -H uirt2_raw /tmp/carrera_tower
# Kernel version (uname -r): 4.9.38-1-MANJARO
#
Aardia - Embraced by Fear
Aardia - Fairy Tales From Beyond
Ablibitum - In a Strange Land
Absu - Mythological Occult Metal (2CD box)
Absurd - Asgardsrei
[GONE] Absurd - Facta Luquuntur (orig! No Colours, #142/500)
Absurd - Tribute to the Tyrants of German Black Metal
Absurd - Werewolfthron
Abysmal - The Pillorian Age
Acid Bath - When the Kite String Pops