Skip to content

Instantly share code, notes, and snippets.

View brianium's full-sized avatar
🕊️
Human

Brian Scaturro brianium

🕊️
Human
View GitHub Profile
@brianium
brianium / interval.go
Created December 18, 2014 19:09
interval.go
import "time"
type Interval struct {
Start Time
End Time
}
func NewInterval(start string, end string) Interval {
startTime, err := time.Parse(time.RFC3339, start)
@brianium
brianium / captain.js
Created December 14, 2014 20:53
multiple inheritance in js
function Entity() {
}
Entity.prototype.entityThing = function() {
console.log("entity thing");
};
function NPC(name) {
Entity.call(this);
this.name = name;

Keybase proof

I hereby claim:

  • I am brianium on github.
  • I am scaturr (https://keybase.io/scaturr) on keybase.
  • I have a public key whose fingerprint is E2A3 8685 A6BD F6A5 2D51 33A5 B242 F6DB 4E9C F051

To claim this, I am signing this object:

@brianium
brianium / koa-xmen-api.js
Last active October 18, 2018 23:55
Koa.js X-MEN Api
var koa = require('koa');
var app = koa();
var json = require('koa-json');
app.use(json());
app.use(function* (next) {
if (this.method != 'GET') return yield next;
if (!/x-men/.test(this.originalUrl)) return yield next;
@brianium
brianium / async.php
Created May 28, 2014 10:51
async hack
<?hh
type SomeResult = shape('property' => int);
function doIoBoundThing(): void {
$nums = array(
100000000,
1000000000,
);
foreach ($nums as $num) {
$i = 0;
@brianium
brianium / php
Created May 4, 2014 01:40
Busted this using namespace in hacklang
<?hh //strict
namespace HackUnit\Runner;
class Options
{
protected ?string $testPath;
public function setTestPath(string $testPath): this
{
$this->testPath = $testPath;
@brianium
brianium / asynctest.php
Last active August 29, 2015 14:00
hacklang async?
<?hh //partial
class TestResult {
public function __construct(public string $message)
{
}
}
class TestCase {
@brianium
brianium / mod10.cs
Created March 27, 2014 19:18
Mod10 algo in C#
void Main()
{
var mod = new Mod10("600649179422170350");
var digit = mod.CheckDigit; //2
var activationNumber = mod.ActivationCardNumber; //6006491794221703502
}
public class Mod10
{
private string _serialNumber;

##Issues, Problems, Impediments

  • Refactoring took up entire session

##Possible Ways To Improve

  • More granular refactoring

##Issues, Problems, Impediments

  • Tool impediment. Vim is a tricky beast. Mainly problems with copy and paste and configuring indentation. Indentation fixed with smart indent, copy broke with smartindent
  • Learning curve with httpBackend, test dependencies inside of a directive’s $compile phase.
  • Overall testing structure. Is it ok to break tests for the same unit into multiple files?

##Possible Ways To Improve

  • Find better ways to copy/paste in vim? Shared buffers in tmux sessions?