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
  • 19:43 (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
};

Keybase proof

I hereby claim:

  • I am kimobrian on github.
  • I am warrior254 (https://keybase.io/warrior254) on keybase.
  • I have a public key ASDg_TdpvhJfjhNjmmF57kv9ZwLSvY_oxD9q3dnqVc-_Jgo

To claim this, I am signing this object:

@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 / components.my-component.js
Last active May 4, 2018 08:06
Test Action Closures
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
logMessage: function() {
this.get('log')();
}
}
});

Keybase proof

I hereby claim:

  • I am kimobrian on github.
  • I am k6i (https://keybase.io/k6i) on keybase.
  • I have a public key ASDNGucP5CPrEnuG2buZ2SXLNCfP66Q1hM2ecAwKRIui4wo

To claim this, I am signing this object:

@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 / server.js
Created February 19, 2018 13:15
Express webpack serve issue
var express = require('express');
var app = express();
var webpack = require('webpack');
var path = require('path');
var compiler = webpack(require('./webpack.config.js'));
app.use(require('webpack-dev-middleware')(compiler, {
noInfo: true,
publicPath: '/'
@kimobrian
kimobrian / apollo-client.md
Last active February 16, 2018 13:12
A gist describing different tools in the GraphQL ecosystem: react-apollo, apollo-client
import { ApolloClient } from 'apollo-client';
import { HttpLink } from 'apollo-link-http'; // HttpLink replaces createNetworkInterface

// Create client that connects to the server
const client = new ApolloClient({
  link: HttpLink({ uri: /* server URL */}),
})