Skip to content

Instantly share code, notes, and snippets.

print "Hello, World!"
value = raw_input("Input your name: ")
print "Hello, " + value + "!"
@bjtitus
bjtitus / gist:205540
Created October 8, 2009 23:47
Some code to play around with Python
import sys
import getopt
def main():
""" print ind(40, [ 55, 77, 42, 12, 42, 100 ])
print ind(42, range(0,100))
print ind('hi', [ 'hello', 42, True ])
print ind('hi', [ 'well', 'hi', 'there' ])
print ind('i', 'team')
print ind(' ', 'outer exploration')
@bjtitus
bjtitus / Perl SafeConnect Bypass
Created January 25, 2011 16:46
SafeConnect Bypass
#!/usr/bin/perl
use Net::Ping;
$host = "www.google.com";
while (1) {
$p = Net::Ping->new('icmp');
if ($p->ping($host)) {
print "$host is alive.\n";
@bjtitus
bjtitus / UIColor+ContrastAdditions.h
Created October 26, 2012 16:13
UIColor contrast additions
//
// UIColor+ContrastAdditions
//
// Created by Brandon Titus (bjtitus.net) on 10/26/12.
//
//
#import <UIKit/UIKit.h>
#import "UIColor-Expanded.h"
@bjtitus
bjtitus / backup-github.sh
Last active May 18, 2022 09:14 — forked from rodw/backup-github.sh
A shell script to backup your Github organization's repos.
#!/bin/bash
# A simple script to backup an organization's GitHub repositories.
GHBU_BACKUP_DIR=${GHBU_BACKUP_DIR-"github-backups"} # where to place the backup files
GHBU_ORG=${GHBU_ORG-"<CHANGE-ME>"} # the GitHub organization whose repos will be backed up
GHBU_API=${GHBU_API-"https://api.github.com"} # base URI for the GitHub API
GHBU_GITHOST=${GHBU_GITHOST-"<CHANGE-ME>.github.com"} # the GitHub hostname (see comments)
# I recommend using an API token so it is easily trackable and removable.
# Note that you MUST have SSH keys for a user with the access to all repos set up
### Keybase proof
I hereby claim:
* I am bjtitus on github.
* I am bjtitus (https://keybase.io/bjtitus) on keybase.
* I have a public key whose fingerprint is A5F4 94EA 5211 28E6 1869 6A1D 7173 093D CF0A B813
To claim this, I am signing this object:
@bjtitus
bjtitus / Crash.log
Created November 2, 2015 15:58
Swift Profile Coverage Mapping Ternary Compiler Crashes
0 swift 0x0000000105bbc33b llvm::sys::PrintStackTrace(__sFILE*) + 43
1 swift 0x0000000105bbca7b SignalHandler(int) + 379
2 libsystem_platform.dylib 0x00007fff8b24052a _sigtramp + 26
3 libc++.1.dylib 0x00007fff8f4d93c6 std::__1::num_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::do_put(std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, char, unsigned long) const + 0
4 swift 0x00000001042f05da swift::Expr::walk(swift::ASTWalker&) + 26
5 swift 0x0000000103ec7951 walkForProfiling(swift::AbstractFunctionDecl*, swift::ASTWalker&) + 225
6 swift 0x0000000103ec732d swift::Lowering::SILGenProfiling::assignRegionCounters(swift::AbstractFunctionDecl*) + 573
7 swift 0x0000000103ed265d (anonymous namespace)::SILGenType::emitType() + 701
8 swift 0x0000000103ed232e swift::Lowering::SILGenModule::visitNominal
@bjtitus
bjtitus / gh-pr
Last active February 14, 2020 21:33
Open current branch in Github
# For Bash or ZSH
function gh-pr() {
branch=`git rev-parse --abbrev-ref HEAD`
prNum=`gh pr list | grep '$branch' | grep -o '[0-9]\+' | head -1`
gh pr view $prNum
}
@bjtitus
bjtitus / gh-issues.fish
Last active August 26, 2020 03:17
GH Tools
# Lists Github issues assigned to you
function gh-issues --description 'Interactively selects Issues'
gh issue view (gh issue list -a 'bjtitus' | sed '/^.*✓/ d' | sed '/^$/d' | fzf --tac --color=16 | grep -oE "\d+" | head -1)
end
@bjtitus
bjtitus / AppStoreGuidelines-2020-09-03.txt
Created September 11, 2020 18:00
App Store September Changes
1. Safety
When people install an app from the App Store, they want to feel confident that it’s safe to do so—that the app doesn’t contain upsetting or offensive content, won’t damage their device, and isn’t likely to cause physical harm from its use. We’ve outlined the major pitfalls below, but if you’re looking to shock and offend people, the App Store isn’t the right place for your app.
1.1 Objectionable Content
Apps should not include content that is offensive, insensitive, upsetting, intended to disgust, in exceptionally poor taste, or just plain creepy. Examples of such content include:
1.1.1 Defamatory, discriminatory, or mean-spirited content, including references or commentary about religion, race, sexual orientation, gender, national/ethnic origin, or other targeted groups, particularly if the app is likely to humiliate, intimidate, or harm a targeted individual or group. Professional political satirists and humorists are generally exempt from this requirement.
1.1.2 Realistic portrayals of people or