Skip to content

Instantly share code, notes, and snippets.

View omnidan's full-sized avatar
📚
published "Learn React Hooks"!

Daniel Bugl omnidan

📚
published "Learn React Hooks"!
View GitHub Profile
@omnidan
omnidan / PyBorg-highlight-reply.patch
Created July 25, 2014 16:51
PyBorg: Always reply on highlight
Subject: [PATCH] always reply to highlight
---
lib/pyborg/pyborg-irc.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/pyborg/pyborg-irc.py b/lib/pyborg/pyborg-irc.py
index 8b8e715..7e1ec25 100755
--- a/lib/pyborg/pyborg-irc.py
+++ b/lib/pyborg/pyborg-irc.py
@omnidan
omnidan / Mocha.sublime-build
Created August 12, 2014 17:09
Mocha build script for sublime text 2/3
{
"shell_cmd": "mocha --require should --bail --reporter spec --no-colors $file",
"shell": true
}
@omnidan
omnidan / chop-benchmark.js
Created October 11, 2014 17:54
CodeKata Kata02 Karate Chop benchmark - http://codekata.com/kata/kata02-karate-chop/
var chops = {};
var benchmark = false;
// solution 1
chops['indexOf'] = function (needle, haystack) {
return haystack.indexOf(needle);
};
// put your other solutions here in the same way as above
@omnidan
omnidan / bot.js
Last active August 29, 2015 14:26
simple coffea irc bot
var client = require('coffea')({
host: 'chat.freenode.net',
nick: 'coffea-testbot',
channels: ['#caffeinery']
});
client.on('command', function (event) {
switch (event.cmd) {
case 'ping':
event.reply('pong');
@omnidan
omnidan / euler.de.py
Created December 20, 2011 20:34
EULER.DE.PY | German version of EULER.PY - A program that calculates the euler number e.
#!/usr/bin/env python
# Die Euler'sche Zahl e
# e = 2 + 1/2 + 1/3 + 1/4 + 1/5 + ...
import traceback
# Display Variablen
DISCALC = False # Berechnungen anzeigen
LOGTIME = False # Zeit/Datum in den Logs anzeigen
# /Display Variablen
@omnidan
omnidan / references.php
Created January 30, 2012 14:13
PHP-References (Pointers) used in the TouchNet
<?php
/**
* These classes maintain references (pointers) in PHP. The first class
* can store one reference only, while the ReferenceContainer can store many
* references at once.
*
* This class is used in the TouchNet to send all modules to all modules.
*
* @author Daniel Bugl
@omnidan
omnidan / entropygen.py
Created April 20, 2012 12:26
EntropyGEN: A script that does random disk operations to generate entropy for private key generation.
#!/usr/bin/env python
from os import system
from sys import argv
print("EntropyGEN v0.4")
print("USAGE: %s <BYTES_PER_SECOND>" % argv[0])
try:
try:
if len(argv) > 1: blen = int(argv[1])
else: blen = 100
@omnidan
omnidan / capkey.c
Created October 3, 2012 17:56
Capture key events from a keyboard/input device.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <dirent.h>
#include <linux/input.h>
#include <sys/types.h>
#include <sys/stat.h>
@omnidan
omnidan / typer.py
Created December 13, 2012 20:59
Simple python module to create a simple typing animation with text in python and to change the color in unix shells.
from sys import stdout
from time import sleep
def type(text, nl=True, delay=0.01, amount=1):
l = list(text)
if amount > 1:
nl = []
i = 0
e = ""
for c in l:
@omnidan
omnidan / countTrelloTasks.js
Last active October 30, 2015 19:52
webhook to listen to trello tasks in a `Done` list
'use strict'
let createStore = require('redux').createStore
let express = require('express')
let bodyParser = require('body-parser')
let fs = require('fs')
// --