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 / honeypot.py
Created December 10, 2011 22:09
HONEYPOT.PY | A simple honeypot written in python.
#!/usr/bin/env python
"""
Copyright (c) 2011, Daniel Bugl
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
@omnidan
omnidan / PrettyJsonResponse.php
Last active July 17, 2019 12:48
Pretty-printed Symfony JsonResponse class. 100% compatible with the original class, requires PHP 5.4.0 or higher.
<?php
/**
* @license WTFPL (Do What the Fuck You Want to Public License)
* @author Daniel Bugl <daniel.bugl@touchlay.com>
*/
namespace TouchLay\HelperBundle\Component;
use Symfony\Component\HttpFoundation\JsonResponse;
@omnidan
omnidan / battery.c
Created April 8, 2012 18:27
A simple battery status output script that can be used for "xsetroot -name" configs.
/*
Copyright (c) 2012, Daniel Bugl
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the

Keybase proof

I hereby claim:

  • I am omnidan on github.
  • I am omnidan (https://keybase.io/omnidan) on keybase.
  • I have a public key ASCJG4SarPaxkAeGXuy6ABt_zAPFl5nsgZRRfv91HPK8JQo

To claim this, I am signing this object:

@omnidan
omnidan / coffea-starter-hashtags.js
Last active May 29, 2016 14:15
coffea-starter with hashtag detection
import dude from 'debug-dude'
const { /*debug,*/ log, info /*, warn, error*/ } = dude('bot')
import { version } from '../package.json'
info(`coffea-starter bot v${version} starting`)
import config from '../config.json'
import { connect, message } from 'coffea'
const networks = connect(config)
const arg1 = (arg) => arg !== 1
const arg2 = (arg) => arg !== 2
function combineFilters (filters) {
return filters.reduce((prev, curr) =>
(arg) => prev(arg) && curr(arg)
, () => true)
}
console.log(combineFilters([arg2, arg1, arg1])(1)); // false
@omnidan
omnidan / 0_reuse_code.js
Created March 16, 2016 15:14
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@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')
// --
@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 / 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>