Skip to content

Instantly share code, notes, and snippets.

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@dergachev
dergachev / GIF-Screencast-OSX.md
Last active February 18, 2025 18:20
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:

@nzakas
nzakas / gist:5511916
Created May 3, 2013 17:47
Using GitHub inside a company

I'm doing some research on how companies use GitHub Enterprise (or public GitHub) internally. If you can help out by answering a few questions, I'd greatly appreciate it.

  1. What is the primary setup? Is there an organization and each official repo is owned by that organization?
  2. Does every engineer have a fork of each repo they're working on?
  3. Are engineers allowed to push directly to the official repo? Or must all commits go through a pull request?
  4. Do engineers work on feature branches on the main repo or on their own forks?
  5. Do you require engineers to squash commits and rebase before merging?
  6. Overall, what is the workflow for getting a new commit into the main repository?
  7. What sort of hooks do you make use of?
  8. Are there any ops issues you encountered? (Scaling, unforeseen downtime, etc.)
@AaronLasseigne
AaronLasseigne / roman.exs
Last active August 14, 2019 14:23
Roman Numerals Code Kata in Elixir
defmodule RomanNumeral do
def convert(n) when n >= 1000, do: remove_and_continue(n, "M", 1000)
def convert(n) when n >= 900, do: remove_and_continue(n, "CM", 900)
def convert(n) when n >= 500, do: remove_and_continue(n, "D", 500)
def convert(n) when n >= 400, do: remove_and_continue(n, "CD", 400)
def convert(n) when n >= 100, do: remove_and_continue(n, "C", 100)
def convert(n) when n >= 90, do: remove_and_continue(n, "XC", 90)
def convert(n) when n >= 50, do: remove_and_continue(n, "L", 50)
def convert(n) when n >= 40, do: remove_and_continue(n, "XL", 40)
def convert(n) when n >= 10, do: remove_and_continue(n, "X", 10)
@rxaviers
rxaviers / gist:7360908
Last active March 10, 2025 05:32
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@Luzifer
Luzifer / 001_usage.md
Last active August 21, 2021 18:13
Fish-Shell: Switch AWS environments

Fish-Shell: Switch AWS environments

How to use

  1. Set up the folder ~/.awsenv/ with the folder structure shown below
  2. Create a credentials.txt for every environment folder (see an example below)
  3. Ensure no other user than yourself can view those files
  4. Create the function set_aws in ~/.config/fish/functions/set_aws.fish (see an example below)
  5. Now load any environment using set_aws <environment> like set_aws private

File structure

@gboudreau
gboudreau / install-ffmpeg-amazon-linux.sh
Last active August 2, 2024 19:25
How to compile ffmpeg on Amazon Linux (EC2)
#!/bin/sh
# Based on instructions found here: http://wiki.razuna.com/display/ecp/FFMpeg+Installation+on+CentOS+and+RedHat#FFMpegInstallationonCentOSandRedHat-InstallX264
if [ "`/usr/bin/whoami`" != "root" ]; then
echo "You need to execute this script as root."
exit 1
fi
cat > /etc/yum.repos.d/centos.repo<<EOF
@marbemac
marbemac / gist:06c5040e4d71694f07b3
Created September 8, 2014 21:08
Ember.js custom serializer for consistent JSON root
// API return format is as so:
// {
// data: [
// {
// name: 'foo'
// },
// {
// name: 'bar'
// }
// ]
@ningsuhen
ningsuhen / Regex.swift
Last active April 27, 2019 18:39
Swift extension for Native String class to support Regex match and Regex replace. Credit - http://www.swift-studies.com/blog/2014/6/12/regex-matching-and-template-replacement-operators-in-swift
import Foundation
struct Regex {
var pattern: String {
didSet {
updateRegex()
}
}
var expressionOptions: NSRegularExpressionOptions {
didSet {
@izqui
izqui / gist:62f11cb52e63f9818e93
Created December 23, 2014 11:48
Swift Async functions
func mapParallel <A, B> (values: [A], task: ( (A, (B) -> () ) -> () ), callback:([B]) -> ()) {
let tasks: [((B) -> ()) -> ()] = values.map({
v in
return {
cb in
task(v, cb)
}
})