Skip to content

Instantly share code, notes, and snippets.

View mattmc3's full-sized avatar
🐍
Python!

mattmc3 mattmc3

🐍
Python!
View GitHub Profile
@netj
netj / csv2tsv.py
Created August 16, 2010 14:38
CSV to TSV python one-liner
#!/usr/bin/env python
import sys,csv
for row in csv.reader(sys.stdin):
print "\t".join(row)
@Olical
Olical / fish_prompt.fish
Created August 14, 2015 17:05
My fish shell lambda prompt functions (they go in ~/.config/fish/functions) it's extremely fast too! :D
# A lambda (λ) prompt.
# Green and red depending on exit status.
# Underlined if git status is dirty.
# Uppercase (Λ) if ahead of the remote.
function fish_prompt
if is_status_okay
set_color green
else
set_color red
@nicerobot
nicerobot / backup.sh
Last active April 15, 2022 23:13 — forked from joneskoo/gist-backup.py
Clone or update a user's gists locally
#!/bin/bash
curl -ks https://gist.githubusercontent.com/nicerobot/1622504/raw/gist-backup.py | USER=${USER} python3
@railwaycat
railwaycat / Emacs_starter.pl
Last active March 12, 2023 01:26
Start Emacs.app from CLI
#!/usr/bin/perl
# Emacs starter for Emacs mac port
# Thanks to Aquamacs Project and David Reitter
my $args = "";
my $tmpfiles = "";
for my $f (@ARGV) {
@lambdamusic
lambdamusic / gist-backup.py
Last active July 27, 2023 14:28 — forked from fedir/gist-backup.py
Clone or update all user's gists #gists
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Forked from https://gist.github.com/fedir/5466075
Changes:
- allows to import Github gists into a local DASH database (https://kapeli.com/dash)
- gists are added to any existing snippet already in database
- filetypes are added, but support is very basic
@Bouke
Bouke / gist:10454272
Last active September 22, 2023 17:23
Install FreeTDS, unixODBC and pyodbc on OS X

First, install the following libraries:

$ brew install unixodbc
$ brew install freetds --with-unixodbc

FreeTDS should already work now, without configuration:

$ tsql -S [IP or hostname] -U [username] -P [password]
locale is "en_US.UTF-8"

locale charset is "UTF-8"

#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
MIT License
Copyright (c) 2016 Matt Menzenski
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@trusktr
trusktr / DefaultKeyBinding.dict
Last active April 17, 2024 11:26
My DefaultKeyBinding.dict for Mac OS X
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more
closely match default behavior on Windows systems. This makes the Command key
behave like Windows Control key. To use Control instead of Command, either swap
Control and Command in Apple->System Preferences->Keyboard->Modifier Keys...
or replace @ with ^ in this file.
Here is a rough cheatsheet for syntax.
Key Modifiers
@vratiu
vratiu / .bash_aliases
Last active April 18, 2024 19:18
Git shell coloring
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off="\[\033[0m\]" # Text Reset
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 19, 2024 11:00
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: