Skip to content

Instantly share code, notes, and snippets.

@arcrose
arcrose / nodejs4celebration.js
Created September 10, 2015 01:23
Playing with some of the new ES6 features supported in JS as of Node.js v4.0
"use strict";
let fs = require('fs');
// ARROW FUNCTIONS!!!
console.log([1,2,3].map(x => x * x));
fs.readFile('./es6.js', (err, content) => console.log(content));
fs.readFile('./es6.js', (err, content) => {
return console.log(content);
});
@arcrose
arcrose / howaboutno.py
Last active June 23, 2016 01:18
A python script to stick it to the man
#! /usr/bin/env python
import sys
import urllib
import webbrowser
urljoin = None
try:
# Python 2

Keybase proof

I hereby claim:

  • I am zsck on github.
  • I am zsck (https://keybase.io/zsck) on keybase.
  • I have a public key whose fingerprint is 4AD7 D615 D697 C911 C5CD 71E1 FA1F 4329 33DB AD6E

To claim this, I am signing this object:

@arcrose
arcrose / .eslintrc.json
Created March 15, 2017 20:55
A Correctness-Oriented ESLint Configuration
{
"env": {
"node": true,
"es6": true
},
"extends": "eslint:recommended",
"rules": {
"array-bracket-spacing": [
"error",
"never"
@arcrose
arcrose / Cargo.toml
Last active April 27, 2017 19:13
Rust JSON API Client With Error Handling
[package]
name = "jsontest"
version = "0.1.0"
authors = ["Zack Mullaly <zsck@riseup.net>"]
[dependencies]
serde = "^1.0"
serde_json = "^1.0"
serde_derive = "^1.0"
@arcrose
arcrose / 1dec1.rs
Last active December 2, 2017 00:07
Answers to the Advent of Code challenges
// Answer to challenge 1 for Advent of Code 2017 on December 1
const MY_INPUT: &str = "INPUT GOES HERE";
/// Creates a vector where each element is a single digit taken from the input string, in order.
///
/// `input` is expected to be a string of digits in base 10.
///
/// # Panics
(ns spacemacs-test.core)
(require '[clojure.string :as str])
; Want to parse strings like the following into some data structure that describes each game.
; E.g. Game 1, team 1 = Los Angeles Clippers, score 1 = 104, team 2 = Dallas Mavericks, score 2 = 88, winner = team 1
(def *example-input* "Los Angeles Clippers 104 Dallas Mavericks 88,New York Knicks 101 Atlanta Hawks 112,Indiana Pacers 103 Memphis Grizzlies 112, Los Angeles Clippers 100 Boston Celtics 12")
(defn- tokenize-game-reports [report-sheet]
(str/split report-sheet #","))
use std::marker::PhantomData;
pub trait Capability<Operation> {
type Data;
type Error;
fn perform(&self, Operation) -> Result<Self::Data, Self::Error>;
}
pub trait Authority<Request> {
@arcrose
arcrose / auth.go
Created August 8, 2018 22:42
Proposal authentication API for MIG
package auth
// AuthSchemeId is used to identify authentication schemes supported by MIG.
type AuthSchemeId string
// Fingerprint is a details-agnostic identifier for a key.
// Implementations of `CryptoAuth` will store keys and which one should be used
// to produce or verify a signature can be specified by indicating the fingerprint
// of the key to use.
type Fingerprint string
@arcrose
arcrose / chart.html
Created June 27, 2019 18:23
Security portfolio chart
<!doctype html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.min.js"></script>
</head>
<body>
<div style="width: 60%; margin-left: auto; margin-right: auto;">
<canvas id="myChart" width="400" height="400"></canvas>
<script>
var ctx = document.getElementById('myChart').getContext('2d');