Skip to content

Instantly share code, notes, and snippets.

View jbasinger's full-sized avatar
🔮
One sec

Justin Basinger jbasinger

🔮
One sec
View GitHub Profile
@jbasinger
jbasinger / DirtyDelegation.rb
Created April 14, 2014 17:59
Component delegation experiment
class Component
attr_accessor :property, :another_property
end
class Entity
def initialize()
@components = {};
@jbasinger
jbasinger / bootstrap.sh
Created December 26, 2014 00:12
Sample Provisioning File for Python Vagrant Box
#!/usr/bin/env bash
#Get Packages
#the -y tells the apt-get program to
#respond with "yes" to every "are you sure" question
apt-get -y update
apt-get install -y python2.7-dev
apt-get install -y curl
apt-get install -y python-pip
@jbasinger
jbasinger / cordova.js
Created January 28, 2015 12:37
Cordova Popup Fixes
<!--<script type="text/javascript" src="cordova.js"></script>-->
<script type="text/javascript">
if (navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry)/)) {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "cordova.js";
document.getElementsByTagName("body")[0].appendChild(script);
script = null;
}
</script>
using UnityEngine;
using System.Collections;
public class ClipToCameraBounds : MonoBehaviour {
private float minPos;
private float maxPos;
private SpriteRenderer renderer;
@jbasinger
jbasinger / BulletMovement.cs
Created June 18, 2015 22:58
BulletMovement
using UnityEngine;
using System.Collections;
public class BulletMovement : MonoBehaviour {
public float speed;
// Use this for initialization
void Start () {
@jbasinger
jbasinger / FireBullet.cs
Last active August 29, 2015 14:23
FireBullet
using UnityEngine;
using System.Collections;
public class FireBullet : MonoBehaviour {
public GameObject bullet;
public float maxCoolDown;
private float timer;
private bool canShoot;
@jbasinger
jbasinger / push.rb
Created July 1, 2015 20:38
Ruby Ionic Push for Android
device_token = 'example_token'
ionic_private_key = 'your_ionic_private_key_here'
ionic_app_id = 'your_ionic_app_id_here'
form_data = {
'tokens' => [device_token],
'notification' => {
'alert' => "Hello Push World!",
'android' => {
'payload' => {
angular.module('yourTotallyAwesomeApp')
.run(function($ionicPlatform, $ionicPush, $ionicUser) {
$ionicPlatform.ready(function() {
//A cheat check to make sure we're on a device
if(window.plugins){
$ionicPush.register({
canRunActionsOnWake: true,
onNotification: function(notification) {
@jbasinger
jbasinger / AppSetupCommands.sh
Created July 2, 2015 19:21
Ionic Push Notification Post Gists
ionic plugin add https://github.com/phonegap-build/PushPlugin.git
ionic add ngCordova
ionic add ionic-service-core
ionic add ionic-service-push
@jbasinger
jbasinger / app.js
Created July 18, 2015 18:57
WeatherOrNot
.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('app', {
url: '/app',
abstract: true,
templateUrl: 'templates/menu.html'
})
.state('app.weather', {