Skip to content

Instantly share code, notes, and snippets.

@jesseokeya
jesseokeya / Git Cheat Sheet.md
Created December 8, 2022 02:11 — forked from rgreenjr/Git Cheat Sheet.md
Git Cheat Sheet

Git Cheat Sheet

Common Commands

# stage all modified files being tracked
git add -u
@jesseokeya
jesseokeya / postgresql_upgrade.sh
Created December 8, 2022 02:10 — forked from rgreenjr/postgresql_upgrade.sh
PostgreSQL Upgrading
# Taken from http://robots.thoughtbot.com/post/33706558963/migrating-data-from-an-upgraded-postgres
#
# Note: these steps assume installation with Homebrew.
# Initialize a new database, adding a .new suffix to the directory that Homebrew recommends.
initdb /usr/local/var/postgres.new -E utf8
# Run the upgrade script, providing the correct paths for the various flags.
@jesseokeya
jesseokeya / go-weird-parts.md
Created December 8, 2022 02:07 — forked from zcaceres/go-weird-parts.md
Go: The Weird Parts – Relating Go to other Languages I Already Know

Go: The Weird Parts

Notes on the unique stuff about go, in the context of other languages that I already know.

Project Organization

  1. Root dir go
  2. src and bin inside the project
  3. unique project/package name

The first statement in a go source file must be package packagenamehere

@jesseokeya
jesseokeya / README.md
Last active December 8, 2022 02:02
README.md Template for new project
@jesseokeya
jesseokeya / postgres_queries_and_commands.sql
Created July 12, 2022 10:07 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'

Disclaimer: I'm not the original author of this sheet, but can't recall where I found it. If you know the author, please let me know so I give the attribution.

Note: Since this seems to be helpful to some people, I formatted it to improve readability of the original. Also, note that this is from 2016, many things may have changed, and I don't use macOS anymore, so I probably can't help in case of questions, but maybe someone else can.

Mac Network Commands Cheat Sheet

After writing up the presentation for MacSysAdmin in Sweden, I decided to go ahead and throw these into a quick cheat sheet for anyone who’d like to have them all in one place. Good luck out there, and stay salty.

Get an ip address for en0:

@jesseokeya
jesseokeya / Sequelize-Step-by-Step.md
Created August 10, 2020 14:09 — forked from zcaceres/Sequelize-Step-by-Step.md
Let's get an overview of Sequelize!

Sequelize: Step-By-Step

Sequelize is a powerful library in Javascript that makes it easy to manage a SQL database. Sequelize can layer over different protocols, but here we'll use PostgreSQL. At its core, Sequelize is an Object-Relational Mapper – meaning that it maps an object syntax onto our database schemas. Sequelize uses Node.JS and Javascript's object syntax to accomplish its mapping.

Under the hood, Sequelize used with PostgreSQL is several layers removed from our actual database:

  1. First, we write our Sequelize, using Javascript objects to mimic the structure of our database tables.
  2. Sequelize creates a SQL string and passes it to a lower-level library called pg (PostgreSQL).
  3. pg connects to your PostgreSQL database and queries it or transforms its data.
  4. pg passes the data back to Sequelize, which parses and returns that data as a Javascript object.
@jesseokeya
jesseokeya / README-Template.md
Created March 13, 2019 03:47 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@jesseokeya
jesseokeya / app.js
Created February 14, 2017 10:04 — forked from sogko/app.js
gulp + expressjs + nodemon + browser-sync
'use strict';
// simple express server
var express = require('express');
var app = express();
var router = express.Router();
app.use(express.static('public'));
app.get('/', function(req, res) {
res.sendfile('./public/index.html');