Skip to content

Instantly share code, notes, and snippets.

View bartekpacia's full-sized avatar
😎
just an enjoyer

Bartek Pacia bartekpacia

😎
just an enjoyer
View GitHub Profile
@jamesmacfie
jamesmacfie / README.md
Created October 22, 2019 02:53
iTerm 2 - script to change theme depending on Mac OS dark mode

How to use

In iTerm2, in the menu bar go to Scripts > Manage > New Python Script

Select Basic. Select Long-Running Daemon

Give the script a decent name (I chose auto_dark_mode.py)

Save and open the script in your editor of choice.

@Zate
Zate / get_go.sh
Last active February 5, 2024 18:19
Shell script to download and install latest golang
#! /bin/bash
# [get_golang.sh](https://gist.github.com/n8henrie/1043443463a4a511acf98aaa4f8f0f69)
# Download latest Golang release for AMD64
# https://dl.google.com/go/go1.10.linux-amd64.tar.gz
set -euf -o pipefail
# Install pre-reqs
sudo apt-get install python3 git -y
o=$(python3 -c $'import os\nprint(os.get_blocking(0))\nos.set_blocking(0, True)')

The PATH is an important concept when working on the command line. It's a list of directories that tell your operating system where to look for programs, so that you can just write script instead of /home/me/bin/script or C:\Users\Me\bin\script. But different operating systems have different ways to add a new directory to it:

Windows

  1. The first step depends which version of Windows you're using:
  • If you're using Windows 8 or 10, press the Windows key, then search for and
@davecan
davecan / open_powershell_here.md
Last active May 3, 2024 16:45
How to enable "Open PowerShell Here" context menu in Windows 10
@tkersey
tkersey / links.md
Last active May 20, 2024 14:58
For future reference but maybe not.
@mattieb
mattieb / out-vs-err.sh
Last active November 21, 2021 10:34
makes output on both stdout and stderr
#!/bin/sh
#
# This script outputs "stdout" to stdout and "stderr" to stderr.
#
# Try it like this and observe the differences:
#
# out-vs-err.sh 2>&1 >/dev/null
# out-vs-err.sh >/dev/null 2>&1
#
# See <http://stackoverflow.com/questions/10508843/what-is-dev-null-21/10508862#comment48709328_10508843>
@cslarsen
cslarsen / objc-gcc.m
Created March 20, 2012 19:23
How to compile Objective-C on the command line on Mac OS X
/*
* To compile objective-c on the command line:
*
* gcc -framework Foundation objc-gcc.m
*
* You may have to link with -lobjc or other libs,
* as required.
*/
#import <Foundation/Foundation.h>

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: