Skip to content

Instantly share code, notes, and snippets.

View davidbarsky's full-sized avatar

David Barsky davidbarsky

View GitHub Profile
@davidbarsky
davidbarsky / Tomorrow Evening
Created June 12, 2013 22:10
A slightly modified Tomorrow Night TextMate theme. The single change is a darker, more saturated navy grey. This is the original [Tomorrow theme repo](https://github.com/chriskempson/tomorrow-theme).
{ settings = (
{ settings = {
foreground = '#C5C8C6';
background = '#1C1B27';
caret = '#AEAFAD';
invisibles = '#4B4E55';
selection = '#373B41';
lineHighlight = '#282A2E';
};
},
@davidbarsky
davidbarsky / MatrixMultiplier.java
Created March 18, 2014 22:08
Multiplies two matrices entered by a user. It's a fun math/logic problem to solve, especially with multiple levels of for loops.
import java.util.*;
import java.lang.Math.*;
public class MatrixMultiplier {
public static void main(String[] args) {
// Object Decleration
Scanner console = new Scanner(System.in);
// Following is for arrayA
@davidbarsky
davidbarsky / config.fish
Last active August 29, 2015 14:07
Fish Config
set -x PATH /usr/local/bin $PATH
# rbenv
set PATH $HOME/.rbenv/bin $PATH
set PATH $HOME/.rbenv/shims $PATH
# editor
set -x VISUAL "atom"
fish_vi_mode
@davidbarsky
davidbarsky / gifinator.sh
Created October 14, 2015 15:56
makes .gifs from live photos (.mov files)
ffmpeg -i input.mov -s 767x1023 -pix_fmt rgb8 -r 10 -f gif - | gifsicle --optimize=10 --delay=7 > output.gif
; ModuleID = '-'
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.11"
%Sa = type <{ %VSs12_ArrayBuffer }>
%VSs12_ArrayBuffer = type <{ %VSs14_BridgeStorage }>
%VSs14_BridgeStorage = type <{ %swift.bridge* }>
%swift.bridge = type opaque
%VSs5Int32 = type <{ i32 }>
%VSs20UnsafeMutablePointer = type <{ i8* }>
const Promise = require('bluebird');
const crypto = Promise.promisifyAll(require('crypto'));
const argon = Promise.promisifyAll(require('argon2-ffi').argon2i);
const securePassword = (rawPassword) => {
crypto.randomBytes(16, (err, salt) => {
if (err) throw err;
argon.hash(rawPassword, salt, (err, hash) => {

Please publicly post the following Gist, and name it keybase.md

Keybase proof

I hereby claim:

  • I am davidbarsky on github.
  • I am thramp (https://keybase.io/thramp) on keybase.
  • I have a public key ASB87gyg5hf8qZGrAB3cvsVSJVIDjWTzwwSy5EL9OjmiDwo
-- This, but with Java’s FutureTasks
main :: IO ()
main = do
message <- getMessage
invoice <- getInvoiceDetail message
insertToDatabase(invoice)

Small file change, no dependencies in Cargo.toml:

time cargo build 
        0.06 real         0.04 user         0.02 sys

Fresh build, with Rustbox as the sole dependency:

time cargo build
❯ RUST_LOG=cargo::ops::cargo_rustc::fingerprint cargo build
DEBUG:cargo::ops::cargo_rustc::fingerprint: fingerprint at: /Users/David/Developer/Rust/husk/target/debug/.fingerprint/husk-08e1418a7b4242d6/lib-husk
INFO:cargo::ops::cargo_rustc::fingerprint: fingerprint error for husk v0.1.0 (file:///Users/David/Developer/Rust/husk): new (rustbox v0.8.1) != old (rustbox v0.8.1)
DEBUG:cargo::ops::cargo_rustc::fingerprint: fingerprint at: /Users/David/Developer/Rust/husk/target/debug/.fingerprint/rustbox-5af69ef25a02d1a5/lib-rustbox
INFO:cargo::ops::cargo_rustc::fingerprint: fingerprint error for rustbox v0.8.1: new (bitflags v0.2.1) != old (bitflags v0.2.1)
DEBUG:cargo::ops::cargo_rustc::fingerprint: fingerprint at: /Users/David/Developer/Rust/husk/target/debug/.fingerprint/libc-264c66f127ecba66/lib-libc
DEBUG:cargo::ops::cargo_rustc::fingerprint: fingerprint at: /Users/David/Developer/Rust/husk/target/debug/.fingerprint/num-1307481cfaedacc7/lib-num
INFO:cargo::ops::cargo_rustc::fingerprint: fingerprint erro