Skip to content

Instantly share code, notes, and snippets.

View Spaceghost's full-sized avatar
👻
Building distributed and decentralized systems that run in the browser

Johnneylee Jack Rollins Spaceghost

👻
Building distributed and decentralized systems that run in the browser
View GitHub Profile
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do
source "https://rubygems.org"
@Spaceghost
Spaceghost / mirror_test.sh
Created January 14, 2021 07:54 — forked from lox/mirror_test.sh
A bash script to select the fastest ubuntu apt geo-mirror
#!/bin/bash -e
# mirror_test.sh
# benchmarks closest ubuntu mirrors and outputs them in speed order
# bash -c "$(curl -fsSL https://gist.githubusercontent.com/lox/9152137/raw/mirror_test.sh)"
RELEASE=$(lsb_release -c -s 2>/dev/null || echo 14.04)
MIRRORS=$(curl -s http://mirrors.ubuntu.com/mirrors.txt)
TESTFILE="dists/$RELEASE/main/binary-amd64/Packages.bz2"
TIMEOUT=1
@Spaceghost
Spaceghost / smux.sh
Created October 3, 2020 04:01
autossh combined with tmux for a mosh like behaior
function smux {
AUTOSSH_POLL=10
AUTOSSH_PORT=$(awk 'BEGIN { srand(); do r = rand()*32000; while ( r < 20000 ); printf("%d\n",r) }' < /dev/null)
#AUTOSSH_GATETIME=30
#AUTOSSH_LOGFILE=autossh.$HOST.log
#AUTOSSH_DEBUG=yes
#AUTOSSH_PATH=/usr/local/bin/ssh
export AUTOSSH_POLL AUTOSSH_LOGFILE AUTOSSH_DEBUG AUTOSSH_PATH AUTOSSH_GATETIME AUTOSSH_PORT
@Spaceghost
Spaceghost / how to install entware on ARM.md
Last active August 29, 2015 14:26 — forked from dreamcat4/how to install entware on ARM.md
Install entware on ARM based router eg tomato / ddwrt / asus-merlin cfw
@Spaceghost
Spaceghost / pr.md
Last active August 29, 2015 14:11 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@Spaceghost
Spaceghost / .README.md
Last active August 29, 2015 14:11 — forked from gnarf/..git-pr.md

Install

Either copy the aliases from the .gitconfig or run the commands in add-pr-alias.sh

Usage

Easily checkout local copies of pull requests from GitHub remotes:

  • git pr 4 - creates local branch pr/4 from the origin remote and checks it out
  • git pr 4 upstream - creates local branch pr/4 from upstream remote and checks it out
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.macports.gpg-agent</string>
<!-- Please uncomment on 10.4; OnDemand doesn't work properly there. -->
<!--
<key>OnDemand</key>
# JS config for NVIDIA SHIELD
# Axes:
# -----
# 1 Left stick H
# 2 Left stick V
# 3 Left trigger
# 4 Right stick H
# 5 Right stick V
# 6 Right trigger
# 7 Pad H
commit 95bcc8ac6463e63001b33094ede2e21796da6c23
Author: Johnneylee Jack Rollins <Johnneylee.Rollins@gmail.com>
Date: Mon Jun 30 07:17:59 2014 -0700
Add Callable and Bindable for services/controllers
* Callable depends on the extending class implementing #call as an
instance method. Another instance method name might be preferable, I
don't know. I've even seen fun dynamic things like `extend
Callable.call_method(:execute)`
class UserCreator
def initialize(listener)
@listener = listener
end
def create(attributes)
user = User.new(attributes)
if user.save
# send email