Skip to content

Instantly share code, notes, and snippets.

View nyimbi's full-sized avatar

Nyimbi Odero nyimbi

  • Datacraft
  • Nairobi
View GitHub Profile
#include "mach_gettime.h"
#include <mach/mach_time.h>
#define MT_NANO (+1.0E-9)
#define MT_GIGA UINT64_C(1000000000)
// TODO create a list of timers,
static double mt_timebase = 0.0;
static uint64_t mt_timestart = 0;
@nyimbi
nyimbi / numbers2latex.scpt
Created February 2, 2016 10:13 — forked from pgundlach/numbers2latex.scpt
numbers2latex table converter
-- Numbers to LaTeX converter
-- this small AppleScript takes the first table in the first sheet of the first
-- Numbers document and turns it into a LaTeX table (well, sort of).
-- It will be copied to the clipboard.
-- This is a 5-minute quick hack and mostly unsupported, but if you like it or
-- if you have any enhancements (not feature request :-)), plese send them to
-- gundlach <at> speedata.de
tell application "Numbers"
@nyimbi
nyimbi / gist:6591656d31d4fca602703b249e03e6aa
Created November 16, 2016 06:57 — forked from movEAX/gist:d128a9602cf93e3dba2e
Postgresql: PL/Python trigger for logging row changes.
CREATE EXTENSION plpython2u;
-- TODO:
-- 1) Кэш соединения с ZMQ
-- 2) Найти оптимальный способ сериализаци данных
-- 3) Рассмотреть вариант с LISTEN/NOTIFY и PGQ
CREATE OR REPLACE FUNCTION row_trigger()
RETURNS TRIGGER
AS $$
import json, zmq
@nyimbi
nyimbi / Flask-SQLAlchemy Caching.md
Created February 21, 2017 06:18 — forked from typehorror/Flask-SQLAlchemy Caching.md
Flask SQLAlchemy Caching

Flask-SQLAlchemy Caching

The following gist is an extract of the article Flask-SQLAlchemy Caching. It allows automated simple cache query and invalidation of cache relations through event among other features.

Usage

retrieve one object

# pulling one User object

user = User.query.get(1)

@nyimbi
nyimbi / mac-apps.md
Created June 20, 2017 13:28 — forked from erikreagan/mac-apps.md
Mac developer must-haves

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik

@nyimbi
nyimbi / 0_reuse_code.js
Created June 20, 2017 13:58
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
@nyimbi
nyimbi / django_cmd.sh
Created November 14, 2017 09:28 — forked from hezhao/django_cmd.sh
Django Commands Cheatsheet
# Use Python 3 for easy unicode
$ virtualenv -p python3 .env
$ source .env/bin/activate
$ pip install django
$ deactivate
# Start new django project and app
$ django-admin.py startproject mysite
$ ./manage.py migrate
$ ./manage.py createsuperuser
@nyimbi
nyimbi / mongo-autostart-osx.md
Created February 7, 2018 09:07 — forked from subfuzion/mongo-autostart-osx.md
mongo auto start on OS X

Install with Homebrew

brew install mongodb

Set up launchctl to auto start mongod

$ ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents

/usr/local/opt/mongodb/ is a symlink to /usr/local/Cellar/mongodb/x.y.z (e.g., 2.4.9)

@nyimbi
nyimbi / .gitignore
Created February 23, 2018 06:20 — forked from maaku/.gitignore
BIP specifying fast merkle trees, as used in the Merkle branch verification opcodes
*~
@nyimbi
nyimbi / The Technical Interview Cheat Sheet.md
Created February 23, 2018 06:33 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.