Skip to content

Instantly share code, notes, and snippets.

View slackmage's full-sized avatar
🔥
Creating things

slackmage slackmage

🔥
Creating things
  • Auricom
  • 22:23 (UTC -04:00)
View GitHub Profile
@kujohn
kujohn / portforwarding.md
Last active April 3, 2025 15:00
Port forwarding in Mavericks

Port Forwarding in Mavericks


Since Mavericks stopped using the deprecated ipfw (as of Mountain Lion), we'll be using pf to allow port forwarding.

####1. anchor file Create an anchor file under /etc/pf.anchors/<anchor file> with your redirection rule like:

@jonschlinkert
jonschlinkert / open-iterm-from-finder.md
Last active July 11, 2024 21:42
Add an icon to your finder toolbar to open iTerm in the current folder.

Open iTerm from finder

The code and instructions in this gist are from http://peterdowns.com/posts/open-iterm-finder-service.html. I've had to do this a few times and wanted to distill it the basics.

  1. Open Automator
  2. Create an Application
  3. Choose Actions > Utilities > Run Applescript
  4. Paste the contents of open_in_iterm.app into the window.
  5. Save the script somewhere convenient
  6. Find the script, then drag the script onto the Finder window while holding the command key (or in Yosemite, the command + option keys)
function convert_to(n, base) {
if (base < 2 || base > 16) {
throw new Error("Invalid base '" + base + "'. Base must be >= 2 or <= 16");
}
if (n === 0) {
return 0;
}
var length = Math.floor(Math.log10(n) / Math.log10(base)) + 1;
@duncan-bayne
duncan-bayne / sp
Last active January 16, 2022 09:53 — forked from wandernauta/sp
sp is a command-line client for Spotify's dbus interface. Play, pause, skip and search tracks from the comfort of your command line.
#!/bin/bash
#
# This is sp, the command-line Spotify controller. It talks to a running
# instance of the Spotify Linux client over dbus, providing an interface not
# unlike mpc.
#
# Put differently, it allows you to control Spotify without leaving the comfort
# of your command line, and without a custom client or Premium subscription.
#
@agarzola
agarzola / stockquote.sh
Created May 12, 2016 02:11
Some functions to get stock info from the command line because who needs friends?
#!/bin/zsh
function stock {
if [[ $* == *--clean* ]]
then
clean=true
else
clean=false
fi
html=$(curl -s https://finviz.com/quote.ashx?t=$1);
-- *********************************************
-- demonstrate how to get the program parameters
-- *********************************************
local internal_name = select(1,...);
local visible_name = select(2,...);
gma.echo("Hello, you loaded the plugin " .. internal_name); -- you will see this message in the system monitor
-- *********************************************