Skip to content

Instantly share code, notes, and snippets.

View osiloke's full-sized avatar
🎯
Focusing

Osi Emoekpere osiloke

🎯
Focusing
View GitHub Profile
# encoding: utf-8
"""
A python logging Handler that use ZeroMQ (ØMQ).
+------+ +------+ +-------+
| app1 | | app2 | | app X |
+------+ +------+ +-------+
| PUSH | PUSH | PUSH
| | |
import zmq
def main():
try:
context = zmq.Context(1)
frontend = context.socket(zmq.SUB)
frontend.bind('tcp://*:5559')
frontend.setsockopt(zmq.SUBSCRIBE, '')
@osiloke
osiloke / curl.md
Created February 14, 2014 09:18 — forked from btoone/curl.md

Introduction

An introduction to curl using GitHub's API

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
class AdImageX(Widget, Ad):
source = None # StringProperty()
texture = None
allow_stretch = BooleanProperty(True)
keep_ratio = BooleanProperty(False)
def __init__(self, **kwargs):
super(AdImageX, self).__init__(**kwargs)
self.opacity = 0
@osiloke
osiloke / image_roller.py
Created August 1, 2014 18:59
This highlights a memory leak i encountered in kivy
import os
import sys
from kivy.core.window import Window
from kivy.graphics.context_instructions import Color
from kivy.uix.floatlayout import FloatLayout
from kivy.lang import Builder
from kivy import Logger
import gc
from kivy.app import App
@osiloke
osiloke / transitions.cpp
Created August 5, 2014 07:27
Trying to figure out why i can't do something
#include "testApp.h"
#define STRINGIFY(A) "#define QUALITY 32 \n uniform float progress; \n uniform vec2 resolution; \n uniform float time; \n uniform sampler2DRect first; \n uniform sampler2DRect second; \n" #A
float width, height;
//--------------------------------------------------------------
void testApp::setup(){
string shaderProgram = STRINGIFY(
void main (void){
vec2 pos = gl_FragCoord.xy;
vec4 src = texture2DRect(second, pos);
@osiloke
osiloke / Bitcask fail to start
Created November 15, 2014 07:30
/var/log/riak/error.log
2014-11-15 07:48:24.038 [error] <0.150.0> Supervisor riak_core_sup had child riak_core_vnode_manager started with riak_core_vnode_manager:start_link() at <0.183.0> exit with reason {{function_clause,[{riak_kv_vnode,terminate,[{bad_return_value,{stop,{init_keydir_scan_key_files,too_many_iterations}}},undefined],[{file,"src/riak_kv_vnode.erl"},{line,1029}]},{riak_core_vnode,terminate,3,[{file,"src/riak_core_vnode.erl"},{line,901}]},{gen_fsm,terminate,7,[{file,"gen_fsm.erl"},{line,597}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]},{gen_fsm,sync_send_event,[<0.662.0>,wait_for_init,infinity]}} in context child_terminated
2014-11-15 07:48:24.039 [error] <0.507.0> CRASH REPORT Process proxy_riak_kv_vnode_776422744832042175295707567380525354192214163456 with 0 neighbours exited with reason: {{{function_clause,[{riak_kv_vnode,terminate,[{bad_return_value,{stop,{init_keydir_scan_key_files,too_many_iterations}}},undefined],[{file,"src/riak_kv_vnode.erl"},{line,1029}]},{riak_core_vnode,terminate,3,[
@osiloke
osiloke / Riak error log 2014-11-14
Created November 15, 2014 18:44
Seems like its a ulimit issue?
2014-11-14 15:05:34.195 [error] <0.187.0> File operation error: emfile. Target: /usr/lib/riak/lib/yokozuna-2.0.0-1-g6ac3a63/ebin. Function: list_dir. Process: riak_core_claimant.
2014-11-14 15:05:34.195 [error] <0.187.0> File operation error: emfile. Target: /usr/lib/riak/lib/cluster_info-2.0.0-0-g1fae829/ebin. Function: list_dir. Process: riak_core_claimant.
2014-11-14 15:05:34.195 [error] <0.187.0> File operation error: emfile. Target: /usr/lib/riak/lib/riak_control-2.0.0-1-gadc50dc/ebin. Function: list_dir. Process: riak_core_claimant.
2014-11-14 15:05:34.195 [error] <0.187.0> File operation error: emfile. Target: /usr/lib/riak/lib/erlydtl-0.7.0/ebin. Function: list_dir. Process: riak_core_claimant.
2014-11-14 15:05:34.195 [error] <0.187.0> File operation error: emfile. Target: /usr/lib/riak/lib/riak_auth_mods-2.0.0-1-g9ae39fe/ebin. Function: list_dir. Process: riak_core_claimant.
2014-11-14 15:05:34.195 [error] <0.187.0> File operation error: emfile. Target: /usr/lib/riak/lib/bear-0.1.3p1-0-gda820a1/ebin.
2014-11-15 07:18:12.091 [error] <0.670.0> scan_key_files: error function_clause @ [{riak_kv_bitcask_backend,key_transform_to_1,[<<>>],[{file,"src/riak_kv_bitcask_backend.erl"},{line,99}]},{bitcask,'-scan_key_files/5-fun-0-',7,[{file,"src/bitcask.erl"},{line,1182}]},{bitcask_fileops,fold_keys_int_loop,5,[{file,"src/bitcask_fileops.erl"},{line,595}]},{bitcask_fileops,fold_file_loop,8,[{file,"src/bitcask_fileops.erl"},{line,720}]},{bitcask_fileops,fold_keys_loop,4,[{file,"src/bitcask_fileops.erl"},{line,575}]},{bitcask,scan_key_files,5,[{file,"src/bitcask.erl"},{line,1190}]},{bitcask,init_keydir_scan_key_files,4,[{file,"src/bitcask.erl"},{line,1283}]},{bitcask,init_keydir,4,[{file,"src/bitcask.erl"},{line,1235}]}]
2014-11-15 07:18:12.133 [error] <0.670.0> scan_key_files: error function_clause @ [{riak_kv_bitcask_backend,key_transform_to_1,[<<>>],[{file,"src/riak_kv_bitcask_backend.erl"},{line,99}]},{bitcask,'-scan_key_files/5-fun-0-',7,[{file,"src/bitcask.erl"},{line,1182}]},{bitcask_fileops,fold_keys_int_loop,5
@osiloke
osiloke / gist:448063e7dc54ad167375
Last active August 29, 2015 14:11
Error when compiling of on mac osx
[4/1051] Building CXX object CMakeFiles/openFrameworks.dir/src/openframeworks/3d/ofCamera.cpp.o
FAILED: /usr/bin/clang++ -DFREEIMAGE_LIB -DPOCO_NO_AUTOMATIC_LIB_INIT -DPOCO_STATIC -fcolor-diagnostics -std=gnu++11 -O3 -DNDEBUG -Wno-deprecated-register -I../src/fontconfig -I../src/fontconfig/src -I../src/freeglut -I../src/freeglut/include -I../src/freeimage -I../src/freeimage/OpenEXR -I../src/freeimage/OpenEXR/Half -I../src/freeimage/OpenEXR/Iex -I../src/freeimage/OpenEXR/IlmImf -I../src/freeimage/OpenEXR/IlmThread -I../src/freeimage/OpenEXR/Imath -I../src/glew -I../src/glew/include -I../src/glfw -I../src/glfw/include -I../src/glfw/include/GLFW -I../src/kiss -I../src/kiss/include -I../src/kiss/src -I../src/poco -I../src/poco/Crypto/include -I../src/poco/Crypto/include/Poco -I../src/poco/Crypto/include/Poco/Crypto -I../src/poco/Foundation/include -I../src/poco/Foundation/include/Poco -I../src/poco/Foundation/include/Poco/Dynamic -I../src/poco/Net/include -I../src/poco/Net/include/Poco -I../src/