Skip to content

Instantly share code, notes, and snippets.

View rymawby's full-sized avatar

Ry Mawby rymawby

View GitHub Profile
@rymawby
rymawby / app.mk
Last active December 9, 2015 12:05
Make file for building and testing Brightscript/Roku apps
#########################################################################
# common include file for application Makefiles
#
# Makefile Common Usage:
# > make
# > make install
# > make remove
#
# Makefile Less Common Usage:
# > make art-opt
@rymawby
rymawby / rokubuild.sublime-build
Created December 8, 2015 18:32
Example build / test shortcuts for a Brightscript project in Sublime Text
{
"shell": true,
"cmd": ["make install"],
"working_dir": "/path/to/project",
"path": "/usr/local/bin:$PATH",
"env":{
"ROKU_DEV_TARGET": "192.168.0.1"
},
"variants": [
@rymawby
rymawby / padawan-to-jedi-improve-with-decorators.md
Created September 17, 2015 20:53
Padawan to Jedi: Improve with Decorators
Class Gun
{	
	shootSound = "Bang"
	function shoot()
	{
		makeNoise(shootSound)
	}
}
@rymawby
rymawby / padawan-to-jedi-droid-height.md
Created September 15, 2015 14:52
Padawan to Jedi: Improve with: Tell don't ask / magic number removal / abstraction
class Ship
{
  function droidWillFitInCockpit() : Boolean
  {
    var droid:Droid = getCurrentDroid()
    var droidHeight:Integer = 0;
    if(this.droid.name == "C-3PO")
    {
 droidHeight = 167
@rymawby
rymawby / stripe-credit-card-numbers.md
Last active August 1, 2025 15:07
Stripe test credit card numbers for use in development

Test credit card numbers to use when developing with Stripe

4242424242424242 Visa

4012888888881881 Visa

4000056655665556 Visa (debit)

@rymawby
rymawby / padawan-tell-dont-ask.as
Created September 14, 2015 14:42
Improve this with "Tell, don't ask".
function getSalary() : Number
var employee:Employee = new Employee()
var salary:Number = employee.salary
if(employee.hasBonus) {
salary = employee.salary * 1.1
}
return salary
}
@rymawby
rymawby / compare-two-files-on-different-git-branches.sh
Created September 2, 2015 14:52
Compare two files on different branches
git diff mybranch master -- myfile.cs
@rymawby
rymawby / delete-a-git-tag.sh
Created June 19, 2015 11:31
Delete a git tag
git tag -d <TAG_NAME>
git push origin :refs/tags/<TAG_NAME>
@rymawby
rymawby / list-changed-files-since-last-push.sh
Created April 16, 2015 11:12
Git - lists changed files since last push to a remote
git diff --stat origin/master
@rymawby
rymawby / remove-dodgy-rebase.sh
Created April 16, 2015 11:08
Remove dodgy git rebase
git reset --hard ORIG_HEAD