Skip to content

Instantly share code, notes, and snippets.

View chrisduong's full-sized avatar

Chris Duong chrisduong

  • Berlin
View GitHub Profile
@chrisduong
chrisduong / curl.md
Created February 27, 2019 08:23 — forked from btoone/curl.md
A curl tutorial using GitHub's API

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
@chrisduong
chrisduong / git_cmd_cheat.md
Last active March 20, 2017 08:07
Git command cheat sheet

Branches

Delete remote branch forcefully

git delete origin --delete <remote branch name>

Create branch from a tag

@chrisduong
chrisduong / psql_schema_cmds.md
Created September 28, 2016 04:26
PostgreSQL schema explorer #cheatSheet

PostgreSQL schema Explorer commands

  • Count number of rows inside a table:
SELECT count(*) FROM myschema.mytable;
@chrisduong
chrisduong / psql_admin_commands.md
Last active September 27, 2016 08:25
PostgreSQL administrative commands cheat sheet

PostgreSQL administrative commands

  • Show active connections
SELECT *
FROM pg_stat_activity;
/* ---------
List current sessions from the "clients" database
@chrisduong
chrisduong / Postgres_permission_cheatsheet.md
Last active September 19, 2016 08:16
#cheatsheet #postgresPermission
  • List all roles
\du
  • List all access privileges within a database
\dp or \z
@chrisduong
chrisduong / git_cheatsheet.md
Last active September 9, 2016 03:41
git #cheatsheet

Branches

Delete the remote branch:

git push origin --delete v0

Tags

Push tag to remote host

@chrisduong
chrisduong / postgres cheatsheet.md
Last active August 9, 2016 09:23 — forked from apolloclark/postgres cheatsheet.md
postgres cheatsheet

Postgres Cheatsheet

This is a collection of the most common commands I run while administering Postgres databases. The variables shown between the open and closed tags, "<" and ">", should be replaced with a name you choose. Postgres has multiple shortcut functions, starting with a forward slash, "". Any SQL command that is not a shortcut, must end with a semicolon, ";". You can use the keyboard UP and DOWN keys to scroll the history of previous commands you've run.

Setup

installation, Ubuntu

http://www.postgresql.org/download/linux/ubuntu/ https://help.ubuntu.com/community/PostgreSQL

@chrisduong
chrisduong / 0_reuse_code.js
Created July 29, 2016 08:40
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
@chrisduong
chrisduong / gdiff
Created June 24, 2016 04:08 — forked from miner/gdiff
using FileMerge as git difftool on Mac OS X
#!/bin/bash
# my git difftool, calls FileMerge with project as -merge target
# better than using opendiff
#
# cd to your project dir and and run difftool like this:
# git difftool -d -x gdiff
# find top level of git project
dir=$PWD
until [ -e "$dir/.git" ]; do
@chrisduong
chrisduong / iterm2.md
Last active July 29, 2016 08:42
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
Previous Tab + Left Arrow
Next Tab + Right Arrow
Go to Tab + Number
Go to Window + Option + Number
Go to Split Pane by Direction + Option + Arrow
Go to Split Pane by Order of Use + ] , + [