Skip to content

Instantly share code, notes, and snippets.

@ttscoff
ttscoff / ReadingListCatcher.py
Created January 6, 2015 15:59
A script for exporting Safari Reading List items to Markdown files and Pinboard bookmarks
#!/usr/bin/python
# ReadingListCatcher
# - A script for exporting Safari Reading List items to Markdown and Pinboard
# Brett Terpstra 2015
# Uses code from <https://gist.github.com/robmathers/5995026>
# Requires Python pinboard lib for Pinboard.in import:
# `easy_install pinboard` or `pip install pinboard`
import plistlib
from shutil import copy
import subprocess
@SteveBenner
SteveBenner / unbrew.rb
Last active January 3, 2024 01:44
Homebrew uninstall script
#!/usr/bin/env ruby
#
# CLI tool for locating and removing a Homebrew installation
# http://brew.sh/
#
# Copyright (C) 2014 Stephen C. Benner
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
@omz
omz / ShortcutGenerator.py
Created December 9, 2013 11:01
ShortcutGenerator
# This script adds a "Webclip" shortcut to your homescreen.
# The shortcut can be used to open a web page in full-screen mode,
# or to launch a custom URL (e.g. a third-party app).
# You'll be asked for a title, a URL, and an icon (from your camera roll)
import plistlib
import BaseHTTPServer
import webbrowser
import uuid
from io import BytesIO
@hfossli
hfossli / gist:7562257
Last active June 27, 2018 04:56
A bash script for fetching all branches and tags of a git project as snapshots into separate folders
#!/bin/bash
# Created by Håvard Fossli <hfossli@gmail.com> in 2013
# This is free and unencumbered software released into the public domain.
# For more information, please refer to <http://unlicense.org/>
#
# Description
# A bash script for fetching all branches and tags of a git project as snapshots into separate folders
#
# Keywords

Spike: Image-based BBC News website

  • Create list of sites to visit: arabic, hindi, russian, mundo, etc.
  • Define supported screen widths, for example: 176, 208, 240, 320, 352.
  • Define the maximum size of an image. The current average size of a mobile page is 250 KB.
  • Quality: 100% - File size: 822 KB: http://goo.gl/A4ldIF
  • Quality: 50% - File size: 272 KB:http://goo.gl/AAbrY9
  • Quality: 30% - File size: 193 KB: http://goo.gl/gOUkXK
  • Crawl sites in a distributed, scalable and efficient way (scheduling policy, async requests, politeness, message queues, path-ascending crawling).
  • Note: The app must run very well on Linux and should also be capable of test runs on OSX.
#!/bin/bash
#
# Get directory of the shell script itself
#
# Read the directory where the shell script is in
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Or resolve the symlink of the file if there is any
@jnschulze
jnschulze / osx_ramdisk.sh
Last active February 5, 2024 13:48
Move Chrome, Safari and iTunes Cache to Ramdisk.
#!/bin/bash
# Size at the end is * 2048 where 2048 = 1 MB, so 1572864 = 768 MB
#DISK=`/usr/bin/hdiutil attach -nobrowse -nomount ram://1572864`
DISK=`/usr/bin/hdiutil attach -nobrowse -nomount ram://2097152`
/usr/sbin/diskutil erasevolume HFS+ "RamDiskCache" $DISK
CACHEDIR="/Volumes/RamDiskCache/$USER"
@dev318
dev318 / makeLocationAndStaticIP.sh
Created September 20, 2013 15:14
Add a network location with manual IP info without switching to it, great for remote changes
#!/bin/bash
# purpose: add a network location with manual IP info without switching
# This script lets you fill in settings and apply them on en0(assuming that's active)
# but only interrupts current connectivity long enough to apply the settings,
# it then immediately switches back. (It also assumes a 'Static' location doesn't already exist...)
# Use at your own risk! No warranty granted or implied! Tell us we're doing it rong on twitter!
# author: Allister Banks, 318 Inc.
# set -x
@nickstenning
nickstenning / gpgedit.sh
Created September 5, 2013 13:31
GPG-encrypted-file editing helpers
#!/bin/sh
#
# gpgedit: edit an encrypted file with an associated list of recipients
#
# $ gpgedit secrets.gpg [gpg args]
#
# gpgedit needs the companion file "secrets.rcp" to exist, and contains a list
# of intended recipients, one per line. The recipient file can contain end-of-
# line comments, starting with the "#" character.
@ihashacks
ihashacks / tor
Created July 30, 2013 06:10
tor init script patch for those of us mounting /var/log in RAM disk
--- tor.init 2013-07-29 23:06:25.329990252 -0700
+++ tor.init-patched 2013-07-28 22:26:13.919215615 -0700
@@ -24,6 +24,7 @@
DAEMON=/usr/sbin/tor
NAME=tor
DESC="tor daemon"
+TORLOGDIR=/var/log/tor
TORPIDDIR=/var/run/tor
TORPID=$TORPIDDIR/tor.pid
DEFAULTSFILE=/etc/default/$NAME