Skip to content

Instantly share code, notes, and snippets.

@mlpinit
mlpinit / postgres cheatsheet.md
Created February 25, 2020 22:44 — forked from gabrieltaylor/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

#!/usr/bin/env ruby
if ARGV[0].nil?
puts "You must provide a file name."
return
end
ENV['TEST'], line_number = ARGV[0].split(":")
line_number = line_number.to_i - 1
@mlpinit
mlpinit / ctags.setup
Created September 25, 2018 14:10 — forked from nazgob/ctags.setup
ctags setup on mac
# you have ctags but it does not work...
$ ctags -R --exclude=.git --exclude=log *
ctags: illegal option -- R
usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
#you need to get new ctags, i recommend homebrew but anything will work
$ brew install ctags
#alias ctags if you used homebrew
$ alias ctags="`brew --prefix`/bin/ctags"

Keybase proof

I hereby claim:

  • I am mlpinit on github.
  • I am mlpinit (https://keybase.io/mlpinit) on keybase.
  • I have a public key ASBJONnRS_Qj8mmEUUgG0FwnDT4XQ4cnGWbW2zScL0c8OAo

To claim this, I am signing this object:

@mlpinit
mlpinit / springer-free-maths-books.md
Created December 29, 2015 03:56 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of maths books available for free, here are the direct links

Keybase proof

I hereby claim:

  • I am mlpinit on github.
  • I am mlpinit (https://keybase.io/mlpinit) on keybase.
  • I have a public key whose fingerprint is 3D47 D633 2DB1 6927 B021 D5A3 CCC0 6204 91EA B59A

To claim this, I am signing this object:

@mlpinit
mlpinit / keypress.rb
Last active August 29, 2015 14:08 — forked from acook/keypress.rb
require 'io/console'
# Reads keypresses from the user including 2 and 3 escape character sequences.
def read_char
STDIN.echo = false
STDIN.raw!
input = STDIN.getc.chr
if input == "\e" then
input << STDIN.read_nonblock(3) rescue nil
# This is a programming chellenge from David Bock's series
# "What Computer Scientists Know". This is a problem that can
# be used to discuss a bunch of computer science topics, but
# as I'm providing most of the skeleton of the solution, the
# point of this exercise is to demonstrate 'recursive backtracking'.
# http://en.wikipedia.org/wiki/Backtracking
# this problem is based on the classic 'triange peg game', a common
# sight in roadside diners in America, in particular, Cracker

Vim Alphabet

a

a enter into insert mode after the character your cursor is on

A enter into insert mode at the end of the current line

b