Skip to content

Instantly share code, notes, and snippets.

View rien333's full-sized avatar

Rijnder Wever rien333

View GitHub Profile
@masak
masak / explanation.md
Last active May 21, 2024 20:05
How is git commit sha1 formed

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <jnthn@jnthn.net>
Date:   Sun Apr 15 16:35:03 2012 +0200

When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.

@ryin
ryin / tmux_local_install.sh
Last active April 23, 2024 01:06
bash script for installing tmux without root access
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=1.8
@kmaed
kmaed / zathurarc
Created July 24, 2012 06:08
Emacs like key bindings for zathura
set adjust-open width
map \< goto top
map \> goto bottom
map b navigate previous
map e follow
map f navigate next
map p goto top
map <C-+> zoom in
@willurd
willurd / web-servers.md
Last active May 25, 2024 13:16
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@tomkrcha
tomkrcha / gist:9009845
Created February 14, 2014 21:36
Detect if Mac OSX space changed in cocoa - NSWorkspaceActiveSpaceDidChangeNotification change / event / notification
@implementation AppDelegate
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
NSNotificationCenter *nc = [[NSWorkspace sharedWorkspace] notificationCenter];
[nc addObserver:self
selector:@selector(spaceChanged:)
name:NSWorkspaceActiveSpaceDidChangeNotification
object:[NSWorkspace sharedWorkspace]];
@RichoDemus
RichoDemus / gist:fa8290b924195bd33e60
Created February 24, 2016 07:31
Remove Manjaro bloat
25 pacman -Rsn flashplugin
26 sudo pacman -Rsn flashplugin
29 sudo pacman -Rsn gimp
33 sudo pacman -Rsn libreoffice-still
36 sudo pacman -Rsn viewnior
40 sudo pacman -Rsn pidgin
43 sudo pacman -Rsn firefox-gtk2
48 sudo pacman -Rsn hexchat
51 sudo pacman -Rsn thunderbird
57 sudo pacman -Rsn guayadeque
@rberenguel
rberenguel / SafariTabSwitcher.lua
Last active April 1, 2022 15:45
An interactive tab chooser for Safari written with AppleScript (yikes) for HammerSpoon (Lua scripting framework for Mac OS automation)
----
-- A tab chooser for Safari written with AppleScript (yikes) and HammerSpoon
----
----
-- Known issues:
-- If a tab has double quotes, unsure about what will happen, the tab
-- list creation is brittle. Single quote is fixed though
@Ruin0x11
Ruin0x11 / mpv-gif.lua
Last active March 26, 2024 01:01
Create animated GIFs using mpv
-- Create animated GIFs with mpv
-- Requires ffmpeg.
-- Adapted from http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html
-- Usage: "g" to set start frame, "G" to set end frame, "Ctrl+g" to create.
local msg = require 'mp.msg'
-- Set this to the filters to pass into ffmpeg's -vf option.
-- filters="fps=24,scale=320:-1:flags=lanczos"
filters="fps=15,scale=540:-1:flags=lanczos"
@charlietran
charlietran / TerminalVim.scpt
Last active October 14, 2023 06:50
Open file in iTerm vim for MacOS Sierra
-- TerminalVim.app
-- This creates a shim Application that will enable you to open files from the Finder in vim using iTerm
-- To use this script:
-- 1. Open Automator and create a new Application
-- 2. Add the "Run Applescript" action
-- 3. Paste this script into the Run Applescript section
-- 4. Save the application as TerminalVim.app in your Applications folder
-- 5. In the Finder, right click on a file and select "Open With". In that window you can set TerminalVim as a default
@j-jith
j-jith / miui-fastboot-howto.rst
Last active May 17, 2024 11:34
How to flash MIUI Fastboot ROM from Linux

How to flash MIUI Fastboot ROM from Linux