Skip to content

Instantly share code, notes, and snippets.

View minikomi's full-sized avatar
🍕
I like pizza

Adam Moore minikomi

🍕
I like pizza
View GitHub Profile
@minikomi
minikomi / gist:1094800
Created July 20, 2011 11:34 — forked from jsmpereira/gist:1094024
Padrino pagination
#
# Adapted from http://pastebin.com/FL5KeQQH
#
# As mentioned on the link above put this on app/helpers/pagination.rb
# and you can use in your view
#
# =will_paginate @posts
#
# I'm also using this https://gist.github.com/837683
#
@minikomi
minikomi / gist:1892015
Created February 23, 2012 09:55 — forked from lezhangxyz/gist:1890401
ctfsh
#!/bin/sh
if [ ! -t 0 ]; then
echo >&2 'STDIN is not a terminal'
exit 1
fi
clear
cd "$(mktemp -d)"
@minikomi
minikomi / LICENSE.txt
Created March 13, 2012 09:19 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@minikomi
minikomi / gist:2505719
Created April 27, 2012 04:21 — forked from j2labs/gist:2502467
abusing python functions
>>> def foo():
... foo.x = 0
... foo.total = lambda: foo.x
... def add(x):
... foo.x = foo.x + x
... return foo
... foo.add = add
...
>>> foo()
>>> foo.total()
@minikomi
minikomi / sort_count.clj
Created May 2, 2012 09:40 — forked from isa/gist:2571012
Convert in less than 30 lines
Question: Convert following into the latter data structure in less than 30 lines:
List:
A, B, C
A, C, E
E, F, D
D, A, J
E, D, J
List
@minikomi
minikomi / allstop.go
Created June 11, 2012 11:04 — forked from kylelemons/allstop.go
Using "close" to stop multiple goroutines
package main
import (
"fmt"
"sync"
)
func main() {
wg := new(sync.WaitGroup)
stop := make(chan bool)
@minikomi
minikomi / pascal.go
Created June 11, 2012 11:05 — forked from aschobel/pascal.go
Pascal's triangle using channels and goroutines
package main
import "fmt"
func worker(row int, input chan int, output chan int, done chan int) {
display := ""
previous := 0
for i := 0; i < row+1; i++ {
read := <-input
display += fmt.Sprintf("%d ", read)
package mapreduce
func MapReduce(mapper func(interface{}, chan interface{}),
reducer func(chan interface{}, chan interface{}),
input chan interface{},
pool_size int) interface{}
{
reduce_input := make(chan interface{});
reduce_output := make(chan interface{});
worker_output := make(chan chan interface{}, pool_size);
@minikomi
minikomi / update.md
Created June 29, 2012 06:21 — forked from anonymous/gist:3014636
Pen type a

Project Update #27: The Storm

For backers only, Posted by cw&t

👯 👯 👯 👯 👯 👯 👯 👯 👯 👯 👯 👯 👯 👯 👯 👯 👯 👯 👯 👯 👯 👯 👯 👯

Hi backers!

First, for those of you still waiting for your pen(s), we're still on schedule. The schedule was posted a few updates ago (update #22). The 3 remaining batches are shipped from our manufacturer in China on :

  • July 7th (480 pens)
@minikomi
minikomi / index.html
Created August 27, 2012 01:01 — forked from bunkat/index.html
Simple Scatter Chart Example
<!DOCTYPE html>
<html>
<head>
<title>The d3 test</title>
<style>
.chart {
shape-rendering: crispEdges;
}
.main text {