Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Tobias Hochgürtel tobiashochguertel

🎯
Focusing
View GitHub Profile
@suhlig
suhlig / install-tmux
Last active Sep 25, 2020 — forked from philipsd6/install-tmux
Install tmux on rhel/centos
View install-tmux
# Install tmux on rhel/centos 7
# What do we want?
libeventversion=2.1.11
tmuxversion=3.1
# install deps
yum install gcc kernel-devel make ncurses-devel
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
@rhukster
rhukster / sphp.sh
Last active Oct 17, 2020
Easy Brew PHP version switching
View sphp.sh
#!/bin/bash
# Creator: Phil Cook
# Modified: Andy Miller
osx_major_version=$(sw_vers -productVersion | cut -d. -f1)
osx_minor_version=$(sw_vers -productVersion | cut -d. -f2)
osx_patch_version=$(sw_vers -productVersion | cut -d. -f3)
osx_patch_version=${osx_patch_version:-0}
osx_version=$((${osx_major_version} * 10000 + ${osx_minor_version} * 100 + ${osx_patch_version}))
brew_prefix=$(brew --prefix | sed 's#/#\\\/#g')
@cheungnj
cheungnj / script.sh
Last active Oct 21, 2020
Convert asciidoc to Github Flavored Markdown
View script.sh
# Adapted from https://tinyapps.org/blog/nix/201701240700_convert_asciidoc_to_markdown.html
# Using asciidoctor 1.5.6.1 and pandoc 2.0.0.1
# Install pandoc and asciidoctor
$ sudo apt install asciidoctor
$ sudo wget https://github.com/jgm/pandoc/releases/download/2.0.0.1/pandoc-2.0.0.1-1-amd64.deb
$ sudo dpkg -i pandoc-2.0.0.1-1-amd64.deb
# Convert asciidoc to docbook using asciidoctor
@bdpwebdesign
bdpwebdesign / key_mapping.md
Last active Sep 10, 2020
Apple Magic Keyboard mapping for Linux Mint
View key_mapping.md

Map an Apple Magic Keyboard to a Linux machine

Configured for a Mac-like experience

Apple Magic Keyboard 2: Model A1644 (same as MLA22LL/A ?)

Mapping for Linux Mint 18 Cinnamon 64-bit

xmodmap source

@miroslavtamas
miroslavtamas / install-apache-maven-3.3.9.sh
Created Apr 22, 2016
Install Apache Maven 3.3.9 on CentOS
View install-apache-maven-3.3.9.sh
#!/bin/sh
wget http://www.eu.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
tar xzf apache-maven-3.3.9-bin.tar.gz
mkdir /usr/local/maven
mv apache-maven-3.3.9/ /usr/local/maven/
alternatives --install /usr/bin/mvn mvn /usr/local/maven/apache-maven-3.3.9/bin/mvn 1
alternatives --config mvn
@domenic
domenic / angularpromise.js
Created Jan 21, 2016
How to subclass a promise
View angularpromise.js
// ES6
class AngularPromise extends Promise {
constructor(executor) {
super((resolve, reject) => {
// before
return executor(resolve, reject);
});
// after
}
@squarism
squarism / iterm2.md
Last active Oct 26, 2020
iterm2 cheatsheet
View iterm2.md

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@rafaeltuelho
rafaeltuelho / install-gosu-centos.md
Created Jul 29, 2015
installing gosu on a centos docker box
View install-gosu-centos.md
# Setup gosu for easier command execution
RUN gpg --keyserver pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
    && curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-amd64" \
    && curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-amd64.asc" \
    && gpg --verify /usr/local/bin/gosu.asc \
    && rm /usr/local/bin/gosu.asc \
    && rm -r /root/.gnupg/ \
    && chmod +x /usr/local/bin/gosu
@murdockcrc
murdockcrc / singleton.js
Created Jul 29, 2015
NodeJS Singleton pattern
View singleton.js
exports = module.exports = (function () {
// Instance stores a reference to the Singleton
var instance;
function init() {
// Singleton
// Private methods and variables
return {
@AndreasPizsa
AndreasPizsa / gist:4eea7957553ed661c4df
Created Nov 7, 2014
Fix Bluetooth Audio hickups on Mac OS X
View gist:4eea7957553ed661c4df
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Max (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" 48
defaults write com.apple.BluetoothAudioAgent "Apple Initial Bitpool (editable)" 40
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool" 48
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Max" 53
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Min" 48
defaults write com.apple.BluetoothAudioAgent "Stream – Flush Ring on Packet Drop (editable)" 30
defaults write com.apple.BluetoothAudioAgent "Stream – Max Outstanding Packets (editable)" 15
defaults write com.apple.BluetoothAudioAgent "Stream Resume Delay" "0.75"
You can’t perform that action at this time.