Skip to content

Instantly share code, notes, and snippets.

View kimobrian's full-sized avatar
Soccer, Music, Code, Friends, Dinners, Cooking

Kimo kimobrian

Soccer, Music, Code, Friends, Dinners, Cooking
  • Nairobi,Kenya
  • 17:46 (UTC +03:00)
View GitHub Profile
@kimobrian
kimobrian / Knex-Migrations-Seeding.md
Created May 24, 2021 10:51 — forked from NigelEarle/Knex-Migrations-Seeding.md
Migration and seeding instructions using Knex.js!

Migrations & Seeding

What are migrations??

Migrations are a way to make database changes or updates, like creating or dropping tables, as well as updating a table with new columns with constraints via generated scripts. We can build these scripts via the command line using knex command line tool.

To learn more about migrations, check out this article on the different types of database migrations!

Creating/Dropping Tables

var p1={
x:0,
y:0
};
var p2={
x:0,
y:1
};
@kimobrian
kimobrian / git-auto-sign-commits.sh
Created June 21, 2019 20:39 — forked from mort3za/git-auto-sign-commits.sh
Auto sign your git commits
# Generate a new pgp key: (better to use gpg2 instead of gpg in all below commands)
gpg --gen-key
# maybe you need some random work in your OS to generate a key. so run this command: `find ./* /home/username -type d | xargs grep some_random_string > /dev/null`
# check current keys:
gpg --list-secret-keys --keyid-format LONG
# See your gpg public key:
gpg --armor --export YOUR_KEY_ID
# YOUR_KEY_ID is the hash in front of `sec` in previous command. (for example sec 4096R/234FAA343232333 => key id is: 234FAA343232333)
@kimobrian
kimobrian / tmux-cheatsheet.markdown
Created April 9, 2018 23:37 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@kimobrian
kimobrian / circleci-heroku-continuous-deployment2.0.md
Created March 6, 2018 09:17 — forked from lauraturk/circleci-heroku-continuous-deployment2.0.md
instructions for deploying from circleci2.0 to heroku
@kimobrian
kimobrian / cmd.sh
Created January 29, 2018 16:10 — forked from kelvinn/cmd.sh
Example of using Apache Bench (ab) to POST JSON to an API
# post_loc.txt contains the json you want to post
# -p means to POST it
# -H adds an Auth header (could be Basic or Token)
# -T sets the Content-Type
# -c is concurrent clients
# -n is the number of requests to run in the test
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/
@kimobrian
kimobrian / client-server-post-request-ex-in-pure-node.md
Created January 28, 2018 21:19 — forked from umidjons/client-server-post-request-ex-in-pure-node.md
Client/Server post request example in pure Node.js

Client/Server POST request example in pure Node.js

File server.js:

var http = require('http');
var querystring = require('querystring');

var server = http.createServer().listen(3000);

server.on('request', function (req, res) {

A Beginner's Guide to Ngrx/store

As someone who is fairly new to the world of Redux and to a certain extent Angular (not AngularJS), the thought of having to implement Redux to our app was very daunting. Not because it wasn't the right thing to do, our initial app was built quite quickly without much knowledge of Angular and in doing so it wasn't very testable, so Redux would help with that situation, the main difficulty was the learning curve.

Reducers; actions, states, the store, this vernacular was familiar to someone who had experience with Redux but not me, and the whole process is quite verbose, I mean–why would you split your code which was originally in one file, the component into multiple, the reducer, action and state? There are however, a lot of companies who use and find a lot of benefits form it, so I decided to do a deep dive into how and why it works and documented my find

@kimobrian
kimobrian / 1_kubernetes_on_macOS.md
Created December 22, 2017 01:42 — forked from kevin-smets/1_kubernetes_on_macOS.md
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites

@kimobrian
kimobrian / introrx.md
Created November 25, 2017 12:11 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing