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 / mutliple-promise.js
Created February 18, 2014 14:48
resolving multiple promises in angular
return $q.all([
Resource.get({var: value}).$promise,
Resource.get({var: otherValue}).$promise
])
public class ConnectionFactory : IConnectionFactory
{
private static readonly IDictionary Strings = new Dictionary<string,string>();
static ConnectionFactory()
{
lock(Strings.SyncRoot)
{
Strings.Add("key", "value");
}
@brianium
brianium / main.html
Created March 22, 2014 14:57
ng-kiosk in action
<body ng-app="grdevday-slides" key-kiosk>
<kiosk src="http://kiosk.hellomean.com/api">
<kiosk-nav topics="topics" />
</kiosk>
<script type="text/javascript" src="bower_components/angular/angular.min.js"></script>
<script type="text/javascript" src="bower_components/angular-sanitize/angular-sanitize.min.js"></script>
<script type="text/javascript" src="bower_components/angular-animate/angular-animate.min.js"></script>
<script type="text/javascript" src="bower_components/ng-kiosk/dist/kiosk.min.js"></script>
<script type="text/javascript" src="application/main.js"></script>

##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?

##Issues, Problems, Impediments

  • Refactoring took up entire session

##Possible Ways To Improve

  • More granular refactoring
@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;
@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 / 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 / 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;

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: