Skip to content

Instantly share code, notes, and snippets.

Tristor /
Last active May 6, 2021
Simple IPtables script for an OpenVPN server
# Flushing all rules
iptables -F FORWARD
iptables -F INPUT
iptables -F OUTPUT
iptables -X
# Setting default filter policy
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
escapedcat /
Last active Feb 12, 2021
Tutorial: Cordova iOS build with fastlane, match and Jenkins

Cordova CI with Jenkins for iOS apps

Inspired by CI server on Mac OS for iOS using GitLab and Fastlane by @v_shevchyk we decided to write down our approach. This will be extended and improved over time.

So you want to deploy your Cordova app, but you hate opening xcode manually to archive and export and sign and cry? Try this. By this we mean we try to explain how to create the following CI (Jenkins) setup:

  • Build Cordova app
  • Create & sign your ipa file
  • Upload to HockeyApp (for Enterprise distribution)

A collection of Linux commands and concepts I tend to forget

GavinJoyce / gist:4f81d0bf879dad6b203e
Last active Nov 20, 2020
speeding up `npm install` by disabling the progress bar
View gist:4f81d0bf879dad6b203e
with `react-native`:
npm set progress=false && rm -rf ~/.npm && rm -rf node_modules && npm cache clean && time npm install
npm install 83.72s user 26.03s system 100% cpu 1:49.32 total
npm set progress=true && rm -rf ~/.npm && rm -rf node_modules && npm cache clean && time npm install
npm install 199.30s user 27.32s system 91% cpu 4:08.29 total
ttscoff / dontforget.bash
Last active May 26, 2021
Quick reminders from Terminal (bash)
View dontforget.bash
# dontforget
# A stupid script for short term reminders in bash
# Arguments just need to contain a number and a bunch of words.
# The number can be anywhere in the arguments, but there shouldn't
# be any other numeric digits.
pixelhandler /
Last active Dec 6, 2015
Bash script to update dependencies (based on release notes) for an ember-cli app or addon, v1.13.8 -> v1.13.13
#!/usr/bin/env bash
# Use with arg $1 as --app or --addon and optional arg $2 as --backup to keep a copy of the original files
# Upgrade Ember-CLI dependencies from 1.13.8 to 1.13.13
# -
# -
# -
robmiller / archive-github.rb
Created Oct 27, 2015
Clones a GitHub repository locally, and then deletes it from GitHub. Useful for cleaning up no-longer-needed private repos. Usage: archive-github OWNER REPO_NAME
View archive-github.rb
#!/usr/bin/env ruby
# archive-github
# Author: Rob Miller <>
# Clones a GitHub repository locally, and then deletes it from GitHub.
# Useful for cleaning up no-longer-needed private repos.
# Assumes you have an OAuth token stored in an environment variable
searls /
Last active Aug 20, 2018
Clone into a new repo and quickly switch into it. Helps avoid a haphazard collection of unorganized github repos all over my home directory. Once it's cloned (or even if it errors), just hit Paste & it'll change into the directory of the repo.
#!/bin/sh -e
# A simple script to keep a tidy ~/code directory organized by owner & then repo
# When the script is done, just hit command-v to switch into the directory
# (Github and Mac only. Sorry, openness!)
# Usage:
# gloan <org>/<repo>
# Or:
# gloan <org> <repo>
searls / duplicate-retro-rasterized-keynote-slides.scpt
Created Oct 20, 2015
Will export the top-level keynote document to one-image-per-build, then downsize to 640x480, then upscale back to 1024x768, then create a new keynote document of one slide per image. Yes, really.
View duplicate-retro-rasterized-keynote-slides.scpt
tell application "Keynote"
if playing is true then tell the front document to stop
if not (exists document 1) then error number -128
display dialog "This script will export the front presentation as images and then create a new presentation containing the exported images." & return & return & "Slide transitions and presenter notes will be transfered from the source presentation." with icon 1
tell front document
steveklabnik /
Created Sep 29, 2015
my summary of "using Rust with Ruby: a deep dive with Yehuda Katz"

My summary of


Rails has a library, ActiveSupport, which adds methods to Ruby core classes. One of those methods is String#blank?, which returns a boolean (sometimes I miss this convention in Rust, the ?) if the whole string is whitespace or not. It looks like this:

It's pretty slow. So Discourse (which you may know from {users,internals} uses the fast_blank gem, which provides this method via a C implementation instead. It looks like this:

For fun, Yehuda tried to re-write fast_blank in Rust. Which looks like this: