Skip to content

Instantly share code, notes, and snippets.

@iamralch
iamralch / tarball.go
Created July 24, 2015 20:35
Tar packages in Go
import (
"archive/tar"
"fmt"
"io"
"os"
"path/filepath"
"strings"
)
func tarit(source, target string) error {
{
"name": "rsms dark v2 mono",
"author": "rsms",
"variables": {
"red": "hsl(5, 0%, 50%)",
"orange": "hsl(27, 0%, 50%)",
"yellow": "hsl(60, 0%, 50%)",
"green": "hsl(150, 0%, 43%)",
"cyan": "hsl(180, 0%, 50%)",
"blue": "hsl(210, 0%, 50%)",
@marc-hanheide
marc-hanheide / ssh.vpn.sh
Created May 27, 2015 20:27
ssh-vpn via ppp (OSX)
#
# You will need to change these variables...
#
# The host name or IP address of the SSH server that we are
# sending the connection request to:
SERVER_HOSTNAME=harek
@kneath
kneath / Guide.md
Created June 8, 2014 01:16
FoldingText 2.0's User Guide

Welcome to the User's Guide

Remember, it's all just text.

FoldingText does some neat things, but in the end you are just typing. If you know how to type, you already know most of what you need to effectively use FoldingText.

(Click "#" to expand headings)


@MTuner
MTuner / fix-sublimetext-subpixel.txt
Last active March 31, 2023 21:44
Fixing font rendering/aliasing in Sublime Text in MacOS Mojave
Apple removed colored sub-pixel antialiasing in MacOS Mojave
(https://developer.apple.com/videos/play/wwdc2018/209/ starting from ~28min)
To make fonts look normal in Sublime Text, add to Preferences:
// For the editor
"font_options": [ "gray_antialias" ],
// For the sidebar / other elements
"theme_font_options": [ "gray_antialias" ],
@gblmarquez
gblmarquez / .tmux.conf
Created August 6, 2015 14:28
.tmux.conf with fish as default shell
# Default termtype. If the rcfile sets $TERM, that overrides this value.
set -g default-terminal screen-256color
# support logging out and back in
set -g update-environment "SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION"
# pbcopy support
set-option -g default-command "reattach-to-user-namespace -l bash"
# vi mode
@apolloclark
apolloclark / postgres cheatsheet.md
Last active March 7, 2024 13:53
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

@richkuz
richkuz / insert-date-mac-osx.md
Created June 12, 2020 15:35
Insert ISO-8601 formatted date yyyy-mm-dd on Mac OSX using a keyboard shortcut

Recently, I converted to using ISO-8601 formatted dates as much as possible, e.g. 2020-06-12. As a meme, I hope this catches on. Dates written this way are internationally recognizable, no confusion over mm/dd/yy or dd/mm/yy. They are sortable. And, when used consistently, they are easy to search; no worries about case sensitivity, or Jun/June spellings. Don’t take my word for it, though. Randall Munroe agrees. So does GitLab.

Here's how to create a keyboard shortcut to insert the current date formatted as ISO-8601.

  1. Launch Automator, and create a new Service.

  2. This particular service receives no input.

  3. Drag in Run AppleScript to the service.

@jojonas
jojonas / st2vim_themes.py
Last active March 28, 2024 16:22
Converter for Sublime Text themes to VIM themes
from __future__ import print_function
import sys
import argparse
import os.path
import textwrap
import re
from pprint import pprint
import xml.etree.ElementTree as ET
@sosedoff
sosedoff / 1_simple.go
Created July 16, 2016 18:45
Golang Custom Struct Tags Example
package main
import (
"fmt"
"reflect"
)
// Name of the struct tag used in examples
const tagName = "validate"