Skip to content

Instantly share code, notes, and snippets.

View mastern2k3's full-sized avatar
🙈
Coding blindfolded

Nitzan Zada mastern2k3

🙈
Coding blindfolded
View GitHub Profile
class Example {
void Main() {
Listener refectListener = new ReflectionListener() {
void received(Connection connection, OneMessage message) {
}
def p_configs(alen):
if alen == 0:
return 1
totals = 0
if alen >= 1:
totals += p_configs(alen - 1)
@mastern2k3
mastern2k3 / print_confs.py
Created February 8, 2018 08:44
Print all binary permutations of a given size and a given amount of ones
def print_confs(c_len, c_ones):
inner_print_confs("", c_len, c_ones)
def inner_print_confs(c_prefix, c_len, c_ones):
if c_len == c_ones:
print(c_prefix + "1" * c_len)
@mastern2k3
mastern2k3 / test_channel_load.go
Created July 18, 2018 13:28
Tester program for a channel and a cosumer
package main
import (
"fmt"
"time"
"github.com/satori/go.uuid"
)
@mastern2k3
mastern2k3 / option.py
Created August 12, 2018 13:53
FP option category in python
class Option(object):
pass
class Some(Option):
def __init__(self, value):
if value is None:
raise "Lol cant have some None"
self.value = value
def map(self, mapper):
@mastern2k3
mastern2k3 / generator_lists_example.py
Created October 9, 2018 12:19
example for list comprehension and generator behavior
def make_io(res):
def new_io():
print("calculated {}".format(res))
return res
print("created {}".format(res))
return new_io
testers = [make_io(n) for n in range(10)]
@mastern2k3
mastern2k3 / makeBatch.go
Last active December 4, 2018 15:18
a skeleton algorithm to batch sizable objects into predefined size limits in go language
package main
import (
"fmt"
"math/rand"
)
type arbitraryData struct {
data []byte
}
import java.util.regex.Matcher;
import java.util.regex.Pattern;
String emojiString = "😋 Get Emoji — All Emojis to ✂ Copy and 📋 Paste 👌";
String emoniRegex = "([\\u20a0-\\u32ff\\ud83c\\udc00-\\ud83d\\udeff\\udbb9\\udce5-\\udbb9\\udcee])";
String extractedEmojis = "";
Matcher matcher = Pattern.compile(emoniRegex).matcher(emojiString);
g=git
ga='git add'
gaa='git add --all'
gap='git apply'
gapa='git add --patch'
gau='git add --update'
gav='git add --verbose'
gb='git branch'
gbD='git branch -D'
gba='git branch -a'
package com.ragnaros.reactor.utils;
import com.badlogic.gdx.Gdx;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;