Skip to content

Instantly share code, notes, and snippets.

💭
🚀 Building Focus, RemoteHabits and something new

Brad Jasper bradjasper

💭
🚀 Building Focus, RemoteHabits and something new
Block or report user

Report or block bradjasper

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bradjasper
bradjasper / http-server.py
Last active Apr 10, 2019 — forked from leoleozhu/http-server.py
SimpleHTTPServer different port
View http-server.py
#!/usr/bin/env python
import SimpleHTTPServer
import SocketServer
PORT = 8919
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
httpd = SocketServer.TCPServer(("", PORT), Handler)
View keybase.md

Keybase proof

I hereby claim:

  • I am bradjasper on github.
  • I am bradjasper (https://keybase.io/bradjasper) on keybase.
  • I have a public key ASC6HgChDmmMjR1--b3QX6n2L3i85MshbOXBX1kDiq69oQo

To claim this, I am signing this object:

View gist:92702a740408a22c325ead0b736120ce
2016-04-22T23:00:52.225Z 0f521c85-08de-11e6-acfd-2177bd93f70f Got createRecurringJob event
{
"input": {
"jobType": "urls",
"urls": [
"http://google.com"
]
},
"schedule": "rate(5 minutes)"
}
@bradjasper
bradjasper / gist:b2af4762756a5df20524
Created Feb 14, 2015
Build, Archive & Export Mac App from command line (rather than Xcode)
View gist:b2af4762756a5df20524
#!/bin/bash
BASE_DIR=$HOME/Projects/focus
BUILD_DIR=$BASE_DIR/Builds
FOCUS_ARCHIVE=$BUILD_DIR/Focus.xcarchive
FOCUS_APP=$BUILD_DIR/Focus.app
echo "Building Focus..."
echo "Cleaning up old archive & app..."
@bradjasper
bradjasper / gist:212337463f826660fec2
Created Feb 1, 2015
Copy & restore Focus preferences
View gist:212337463f826660fec2
Here's how to copy & restore Focus preferences
1) (On old computer) Copy preferences file to desktop. This BradJasper.Focus.plist file saves all of your settings. You can back this up in Dropbox if you want.
cp ~/Library/Preferences/BradJasper.Focus.plist ~/Desktop/
2) (On new computer) Kill focus & preferences monitor
killall Focus; killall cfprefsd;
@bradjasper
bradjasper / is_focus_active
Created Jan 9, 2015
Small BASH script to check if Focus is currently activated
View is_focus_active
ACTIVE_NETWORK=$(echo "open|||get Setup:/Network/Service/$(echo "open|||get State:/Network/Global/IPv4|||d.show" | tr '|||' '\n' | scutil | grep "PrimaryService" | awk '{print $3}') |||d.show" | tr '|||' '\n' | scutil | grep "UserDefinedName" | awk -F': ' '{print $2}')
FOCUS_BLACKHOLE_PID=$(ps aux | grep FocusBlackholeProxy | grep -v grep | awk '{print $2}')
PROXY_URL_OUTPUT=$(networksetup -getautoproxyurl "$ACTIVE_NETWORK")
if [[ $PROXY_URL_OUTPUT == *"focus"* ]]
then
echo "Focus is active!"
else
echo "Focus is not active"
View remove_focus.sh
#!/bin/bash
ACTIVE_NETWORK=$(echo "open|||get Setup:/Network/Service/$(echo "open|||get State:/Network/Global/IPv4|||d.show" | tr '|||' '\n' | scutil | grep "PrimaryService" | awk '{print $3}') |||d.show" | tr '|||' '\n' | scutil | grep "UserDefinedName" | awk -F': ' '{print $2}')
echo "Active network is '$ACTIVE_NETWORK'"
echo "Turning off active network PAC"
sudo networksetup -setautoproxystate "$ACTIVE_NETWORK" off
echo "Removing NSUserDefaults"
View LICENSE
Copyright (c) 2013 Jamz Tang <jamz@jamztang.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
View itunesicon.rb
#!/usr/bin/ruby
# encoding: utf-8
#
# Grab iTunes Icon - Brett Terpstra 2014 <http://brettterpstra.com>
#
# Retrieve an iOS app icon at the highest available resolution
# All arguments are combined to create an iTunes search
# The icon for the first result, if found, is written to a filename based on search terms
#
# example:
View gist:7436681
# ANSI color codes
RESET="\[\033[0m\]" # reset
HICOLOR="\[\033[1m\]" # hicolor
UNDERLINE="\[\033[4m\]" # underline
INVERSE="\[\033[7m\]" # inverse background and foreground
FBLACK="\[\033[30m\]" # foreground black
FRED="\[\033[31m\]" # foreground red
FGREEN="\[\033[32m\]" # foreground green
FYELLOW="\[\033[33m\]" # foreground yellow
FBLUE="\[\033[34m\]" # foreground blue
You can’t perform that action at this time.