This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::collections::HashMap; | |
use std::io; | |
use std::num::ParseFloatError; | |
use std::rc::Rc; | |
/* | |
Types | |
*/ | |
#[derive(Clone)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am raskchanky on github. | |
* I am raskchanky (https://keybase.io/raskchanky) on keybase. | |
* I have a public key ASDzqYUXe_xOTO2umVIxRP6wzC5iL7TikgIcjowGiCibLQo | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# The purpose of this script is to download the latest stable version of every | |
# package in the core-plans repo, tar them up, and upload to S3. It also supports | |
# downloading the archive from S3, extracting it, and uploading to a new depot. | |
# | |
# There are some environment variables you can set to control the behavior of this | |
# script: | |
# | |
# HAB_ON_PREM_BOOTSTRAP_BUCKET_NAME: This controls the name of the S3 bucket where |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
var timeout = 100000; | |
http.createServer(function (req, res) { | |
setTimeout((function() { | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
res.end("Success"); | |
}), timeout); | |
}).listen(8080); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
name=`date | md5` | |
tmux new-session -d -s $name | |
tmux split-window -h -p 40 | |
if [ "$1" = "2" ] | |
then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"what are functions if not tiny, mostly stateless objects? (Honest question)" | |
Classic OOP says you should break things down as small as possible. It's better to have 10 classes, each | |
doing 1 specific thing, then it is to have 1 class doing 10 different things. Methods should be very small. | |
I've seen guidelines on how many lines your methods should be. | |
What I've noticed about OO projects that involve lots of tiny classes, is that as the number of classes | |
increases, it becomes increasingly difficult to keep track of how the system as a whole works, because | |
there are so many individual components of it. Figuring out how the system performs some task X is a | |
spelunking expedition, as you need to dig through sometimes dozens of classes before finally finding the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn hamming-distance [a b] | |
(->> | |
(map #(= %1 %2) a b) | |
(filter false?) | |
count)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ "$1" == "" ]; then | |
echo "usage: ssbg [start|stop]" | |
exit | |
fi | |
if [ "$1" == "start" ]; then | |
echo STARTING | |
/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A manager went to the master programmer and showed him the requirements document for a new application. | |
The manager asked the master: "How long will it take to design this system if I assign five programmers | |
to it?" | |
"It will take one year," said the master promptly. | |
"But we need this system immediately or even sooner! How long will it take if I assign ten programmers | |
to it?" | |
The master programmer frowned. "In that case, it will take two years." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2012 Erlware, LLC. All Rights Reserved. | |
# | |
# This file is provided to you under the Apache License, | |
# Version 2.0 (the "License"); you may not use this file | |
# except in compliance with the License. You may obtain | |
# a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, |
NewerOlder