Skip to content

Instantly share code, notes, and snippets.

View mipmip's full-sized avatar
🐟

Pim Snel mipmip

🐟
View GitHub Profile
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@mipmip
mipmip / gist:1844353
Created February 16, 2012 12:00
Mac OS X: restart mDNSResponder
Load up Terminal (Applications > Utilities > Terminal.app) and type the following.
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
To turn it back on, just do the opposite:
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
@gadzhimari
gadzhimari / adobe_cc.md
Created November 22, 2018 11:29
Completely Remove Adobe from your Mac in 2 Steps

Step 1

Download and run the Adobe Creative Cloud Cleaner Tool, their multi-app uninstaller and wipe assistant. Adobe does recommend running individual application uninstallers first, your call. Click the Clean All option.

Step 2

Type a one line command in terminal find ~/ -iname "*adobe*" and it's shows up all files which match pattern.

To remove all files

`sudo rm -rf /Applications/Adobe* /Applications/Utilities/Adobe* /Library/Application\ Support/Adobe /Library/Preferences/com.adobe.* /Library/PrivilegedHelperTools/com.adobe.* /private/var/db/receipts/com.adobe.* ~/Library/Application\ Support/Adobe* ~/Library/Application\ Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.adobe* ~/Library/Application\ Support/CrashReporter/Adobe* ~/Library/Caches/Adobe ~/Library/Caches/com.Adobe.* ~/Library/Caches/com.adobe.* ~/Library/Cookies/com.adobe.* ~/Library/Logs/Adobe* ~/Librar

@chrisdiana
chrisdiana / mosh-macos.md
Last active May 8, 2024 16:16
Getting mosh server running on macOS Catalina

Running into this error message when trying to run a mosh server on macOS Catalina? The steps below should solve the problem which is most likely either a $PATH and/or firewall issues.

command not found: mosh-server
Connection to X.X.X.X closed.
/usr/local/bin/mosh: Did not find mosh server startup message. (Have you installed mosh on your server?)

1. Install Mosh

@todgru
todgru / starttmux.sh
Last active April 27, 2024 18:17
Start up tmux with custom windows, panes and applications running
#!/bin/sh
#
# Setup a work space called `work` with two windows
# first window has 3 panes.
# The first pane set at 65%, split horizontally, set to api root and running vim
# pane 2 is split at 25% and running redis-server
# pane 3 is set to api root and bash prompt.
# note: `api` aliased to `cd ~/path/to/work`
#
session="work"
@spacepluk
spacepluk / gnowesome.dconf
Last active April 6, 2024 03:02
awesome-ish key bindings for gnome-shell
[org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0]
binding='<Super>Return'
command='urxvtc'
name='Open Terminal'
[org/gnome/desktop/wm/preferences]
action-middle-click-titlebar='none'
mouse-button-modifier='<Super>'
num-workspaces=9
@manveru
manveru / base64.nix
Created September 6, 2023 03:19
Encode to base 64 in pure Nix
{lib, ...}: {
toBase64 = text: let
inherit (lib) sublist mod stringToCharacters concatMapStrings;
inherit (lib.strings) charToInt;
inherit (builtins) substring foldl' genList elemAt length concatStringsSep stringLength;
lookup = stringToCharacters "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
sliceN = size: list: n: sublist (n * size) size list;
pows = [(64 * 64 * 64) (64 * 64) 64 1];
intSextets = i: map (j: mod (i / j) 64) pows;
compose = f: g: x: f (g x);
# Syntax
nix run github:<owner>/<repo>/<revision>#<executable>
# Examples
## Specific commit ID
nix run github:DeterminateSystems/riff/a71a8b5ddf680df5db8cc17fa7fddd393ee39ffe
## Tag
@senderle
senderle / hand-modify-pdf.md
Created September 23, 2020 15:03
So you want to modify the text of a PDF by hand

So you want to modify the text of a PDF by hand...

If you, like me, resent every dollar spent on commercial PDF tools, you might want to know how to change the text content of a PDF without having to pay for Adobe Acrobat or another PDF tool. I didn't see an obvious open-source tool that lets you dig into PDF internals, but I did discover a few useful facts about how PDFs are structured that I think may prove useful to others (or myself) in the future. They are recorded here. They are surely not universally applicable --
the PDF standard is truly Byzantine -- but they worked for my case.

@devinodaniel
devinodaniel / gist:8f9b8a4f31573f428f29ec0e884e6673
Created November 21, 2017 20:18
Generate SSH RSA Private/Public Key pair with Golang
// This shows an example of how to generate a SSH RSA Private/Public key pair and save it locally
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"encoding/pem"
"golang.org/x/crypto/ssh"