Skip to content

Instantly share code, notes, and snippets.

View maurerbot's full-sized avatar

Adrian maurerbot

View GitHub Profile

amaurer Adrian Maurer Software developer Toronto

Keybase proof

I hereby claim:

### Keybase proof
I hereby claim:
* I am adrianmaurer on github.
* I am amaurer (https://keybase.io/amaurer) on keybase.
* I have a public key whose fingerprint is 1E8F BE96 3922 A25D CB00 3566 8DCC 54DA 7631 D0F4
To claim this, I am signing this object:
@maurerbot
maurerbot / gist:f9a302b7400531ea8efd
Last active August 29, 2015 14:01
Fancy Bash Git Prompt
curl https://raw.github.com/git/git/master/contrib/completion/git-prompt.sh -o ~/.git-prompt.sh`

update your ~/.bash_profile

PS1='\[\033[0;32m\]┌┼─┼─ \[\033[0m\033[0;32m\]\u\[\033[0m\] @ \[\033[0;36m\]\h\[\033[0m\033[0;32m\] ─┤├─ \[\033[0m\]\t \d\[\033[0;32m\] ─┤├─ \[\033[0;31m\]\w\[\033[0;32m\] ─┤\[$(__git_ps1)\]\n\[\033[0;32m\]└┼─\[\033[0m\033[0;32m\]\$─┤▶\[\033[0m\] '
@maurerbot
maurerbot / GravitationalPull.cs
Last active August 21, 2018 19:40
Gravitational pull in Unity
// Get all the objects in range
Collider[] cols = Physics.OverlapSphere(transform.position, range);
// Assign the first object as the nearest for now
Collider nearest = cols[0];
// Loop through objects
foreach (Collider c in cols)
{
// Get the current objects rigidbody
Rigidbody rb = c.attachedRigidbody;
@maurerbot
maurerbot / MeetupAuthActivity.java
Last active January 12, 2017 04:46
Created this to authenticate meetup for an android app.
import android.content.ContentValues;
import android.net.Uri;
import android.os.AsyncTask;
import android.util.Log;
import android.view.Window;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Toast;
// leeloo oAuth lib https://bitbucket.org/smartproject/oauth-2.0/wiki/Home
""""Create "The Matrix" of binary numbers scrolling vertically in your terminal.
original code adapted from juancarlospaco:
- http://ubuntuforums.org/showpost.php?p=10306676
Inspired by the movie: The Matrix
- Corey Goldberg (2013)
Requires:
@maurerbot
maurerbot / manifest_generator.sh
Last active December 10, 2015 20:18
HTML5 Manifest Generator and Watcher
#!/bin/bash
#This script watches your project folder and outputs a HTML5 Manifest to $OUT
#You may need to change the location of your depency scripts
#Dependencies: confess.js and phantomjs
#Usage: sh manigest_generator.sh <url> <dir>
#Author Adrian Maurer (https://github.com/adrianmaurer)
#Based on http://stackoverflow.com/questions/2972765/linux-script-that-monitors-file-changes-within-folders-like-autospec-does
#sh manifest_generator.sh $URL $DIR $OUT
@maurerbot
maurerbot / gist:3138076
Created July 18, 2012 18:56 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@maurerbot
maurerbot / C++.sublime-build
Created June 20, 2012 23:27
Getting Sublime Text to build a C file.
{
"cmd": ["g++", "$file", "-o", "$file_base_name", "-I/usr/local/include"],
"selector": "source.c++",
"windows":
{
"cmd": ["cl", "/Fo${file_path}", "/O2", "$file"]
}
}
@maurerbot
maurerbot / object-watch.js
Created June 14, 2012 16:29 — forked from eligrey/object-watch.js
object.watch polyfill
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/