Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@alexmoore
alexmoore / push.rb
Created August 31, 2012 21:46
[hg]|[git] push -m 'it real good'
require 'Win32API'
Beep = Win32API.new('kernel32', 'Beep', ['I', 'I'], 'I')
def Rest(ms)
sleep(ms / 1000.0)
end
c = 1046
d = 1175
e = 1319
package Blah;
import java.util.Iterator;
import java.util.NoSuchElementException;
public class SelectManyIterable<TSource, TResult> implements Iterable<TResult>
{
public interface TransformProvider<TSource, TResult>
{
@alexmoore
alexmoore / vnode_helper.rb
Last active December 16, 2015 21:59
Little helper class to figure out on which vnodes a particular hash resides.
class VNodeHelper
attr_reader :ring_size, :n_val
def initialize(ring_size, n_val)
@ring_size = ring_size
@n_val = n_val
@vnode_size = (2 ** 160 / @ring_size)
end
{
"Id": "Policy1371509616384",
"Statement": [
{
"Sid": "Stmt1371509665536",
"Action": [
"s3:GetObject"
],
"Effect": "Allow",
"Resource": "arn:aws:s3:::BUCKET_NAME/*",
-module(fizzbuzz).
-export([print_fizz_buzz/0,fizzbuzz/1]).
print_fizz_buzz() ->
Each = fun(I) ->
print_fizz_buzz(fizzbuzz(I)) end,
lists:foreach(Each, lists:seq(1,100)).
print_fizz_buzz(I) when is_integer(I) -> io:fwrite("~p~n", [I]);
print_fizz_buzz(I) -> io:fwrite("~s~n", [I]).
@alexmoore
alexmoore / .emacs
Created September 30, 2013 16:25
Add this to your .emacs file to autoload the tools for the current erlang with https://github.com/alexmoore/erls
;; setup erlang mode
(setq erlang-root-dir "/Users/alex/erlangs/current")
(setq erlang-lib-dir (concat erlang-root-dir "/lib/erlang/lib"))
(setq load-path
(cons (concat erlang-lib-dir
"/"
(car (directory-files erlang-lib-dir nil "^tools\-"))
"/emacs" )
load-path))
function doubleInteger(i) {
return i*2;
}
function isNumberEven(i) {
return i%2 === 0;
}
function getFileExtension(i) {
if(i.indexOf('.') >= 0) {
using System;
using System.Numerics;
using System.Globalization;
using System.Text;
using System.Diagnostics;
using System.Threading;
namespace StringPaddingTest
{

#Oh the Schemas you can Scheme!

You can scheme about scaling
Of which SQL can only dream!
You can scheme about NoSQL
Oh the schemas you can scheme

Oh, the schemes you can scheme up
if only you try!
If you try, you can scheme up

Just Open a Socket - https://www.youtube.com/watch?v=jytJXjI0oQU