Skip to content

Instantly share code, notes, and snippets.

@maiah
maiah / file_upload_sample.dart
Created October 19, 2012 10:05
File Upload Sample in Dart
final List<int> data = new List<int>();
req.inputStream.onData = () {
data.addAll(req.inputStream.read());
};
req.inputStream.onClosed = () {
String dataString = new String.fromCharCodes(data);
List<String> contents = dataString.split('\n');
@maiah
maiah / test_view.js
Created November 22, 2012 04:02
Component View Sample Usage
var domify = require('domify');
var View = require('view');
var html = '<input type="text" class="name"></input>';
var Person = function(name) {
this.name = name;
};
var maiah = new Person('Maiah Macariola');
@maiah
maiah / ll-add.js
Created August 19, 2013 09:32
LLJS sample typed-function
function int add(int a, int b) {
return a + b;
}
let int sum = add(5, 7);
trace('sum = ' + sum);
@maiah
maiah / index.js
Created January 15, 2014 11:02
requirebin sketch
var dom = require('dom');
var bodyContent = '<div class="container">' +
'<span class="title">Click the sentence below</span>' +
'<br>' +
'<span class="msg">Hello classy</span>' +
'</div>';
var content = dom(bodyContent)[0];
@maiah
maiah / JQuery-Card.markdown
Created January 28, 2014 13:12
A Pen by Maiah Macariola.
@maiah
maiah / Navigation-Controls.markdown
Created January 29, 2014 06:50
A Pen by Maiah Macariola.
@maiah
maiah / .vimrc
Last active July 14, 2016 10:13
Sample .vimrc config
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
@maiah
maiah / immutable_collection.go
Created October 2, 2015 09:03
Copy Method for Immutable slices and maps
package main
import "fmt"
type nums []int
func (n nums) copy() []int {
dest := make(nums, len(n))
copy(dest, n)
return dest
@maiah
maiah / main.go
Last active October 19, 2015 01:39
Something like Reduce, Map, and Collect in Go
package main
import (
"fmt"
"strconv"
)
type Power struct {
up int
}
@maiah
maiah / main.go
Created October 19, 2015 07:45
Streaming Reduce, Map, and Collect in Go
package main
import (
"fmt"
"strconv"
)
type Power struct {
up int
}