Skip to content

Instantly share code, notes, and snippets.

@cmj
cmj / twitter_oauth.sh
Last active March 21, 2024 15:09
Grab oauth token for use with Nitter (requires Twitter account)
#!/bin/bash
# Grab oauth token for use with Nitter (requires Twitter account).
# results: {"oauth_token":"xxxxxxxxxx-xxxxxxxxx","oauth_token_secret":"xxxxxxxxxxxxxxxxxxxxx"}
username=""
password=""
if [[ -z "$username" || -z "$password" ]]; then
echo "needs username and password"
exit 1
@b0gdanw
b0gdanw / DisableBigSur.sh
Last active June 14, 2024 13:33
Disable Big Sur services
#!/bin/zsh
#Credit: Original idea and script disable.sh by pwnsdx https://gist.github.com/pwnsdx/d87b034c4c0210b988040ad2f85a68d3
#Disabling unwanted services on macOS 11 Big Sur (11) and macOS Monterey (12)
#Disabling SIP is required ("csrutil disable" from Terminal in Recovery)
#Modifications are written in /private/var/db/com.apple.xpc.launchd/ disabled.plist and disabled.501.plist
# user
TODISABLE=()
@allexradu
allexradu / setup.md
Last active March 28, 2024 20:02 — forked from novemberborn/setup.md
OS X Setup virtual hosts on two different ports

Changes with .dev domains in mind.

Step 1 : Assign at least two IP address to your MAC OS (one per domain), let's say :

192.168.0.51
192.168.0.52

To setup the second IP you will have to add a second Ethernet Adapter (logical not physical).

@amomchilov
amomchilov / DownloadProgressIndicatorDemo.swift
Last active July 9, 2024 17:56 — forked from mminer/DownloadProgressIndicatorDemo.swift
Displays a progress indicator on a file in the Finder.
import Cocoa
let path = "/Users/You/Pick/Any/Random/File/On/Your/System.txt"
let destination = URL(fileURLWithPath: path)
let progress: Progress = {
let p = Progress(parent: nil, userInfo: [
.fileOperationKindKey: Progress.FileOperationKind.downloading,
.fileURLKey: destination,
])
@mowings
mowings / README.md
Last active July 22, 2024 12:18
Set up xhyve with Ubuntu 16.04

Introduction

Setting up an OS to work with xhyve can be a bit tricky, but it's not impossible. These intructions should be generally applicable to most versions of Linux.

Create a disk image file

Xhyve will use a file as a logical disk. Be sure you have the filesize you need, because growing the file later is tricky to impossible (you could try to use qcow or similar to get around this, but qcow volumes can be tricky to mount).

dd if=/dev/zero of=hdd.img bs=1g count=32 # Create a 32 gig disk. Raise 'count' as desired
@wojteklu
wojteklu / gitenv.md
Last active July 7, 2024 14:20
Perfect git environment on OS X

Perfect git environment on OS X

Global alias

Add the following to your ~/.bashrc:

alias g='git'

Branch auto-completion