Skip to content

Instantly share code, notes, and snippets.

View drawcode's full-sized avatar
😎
Shipping product

Ryan Christensen drawcode

😎
Shipping product
View GitHub Profile
@drawcode
drawcode / gist:4632023
Created January 25, 2013 05:34
Check if app installed and redirect to download.
function startiThrown() {
document.location = appurl;
var time = (new Date()).getTime();
setTimeout(function(){
var now = (new Date()).getTime();
if((now-time)<400) {
if(confirm('You do not seem to have iThrown installed, do you want to go download it now?')){
document.location = 'http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=293049283&mt=8&uo=6';
}
@drawcode
drawcode / gist:4632373
Created January 25, 2013 06:54
mono config
<VirtualHost *:80>
ServerName drawcode.com
ServerAlias drawcode.com
ServerAlias www.drawcode.com
ServerAdmin web-admin@drawcode.com
DocumentRoot /srv/www/drawcode.com
# MonoServerPath can be changed to specify which version of ASP.NET is hosted
# mod-mono-server1 = ASP.NET 1.1 / mod-mono-server2 = ASP.NET 2.0
# For SUSE Linux Enterprise Mono Extension, uncomment the line below:
# MonoServerPath drawcode.com "/opt/novell/mono/bin/mod-mono-server2"
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
#!/usr/bin/env python
#install the follow first:
#sudo easy_install pip
#sudo pip install -U boto
#sudo pip install configparser
@drawcode
drawcode / kernel.sh
Last active December 13, 2015 04:39
get *nix os and version
uname -a
@drawcode
drawcode / flip.css
Last active December 14, 2015 00:59
flip card back/front
.card .front, .card .back {
float: none;
position: absolute;
top: 0;
left: 0;
width: inherit;
height: inherit;
border: 1px solid #dddddd;
padding: 1px;
-webkit-transform-style: preserve-3d;
@drawcode
drawcode / UnityAndroidIntentAction.cs
Created February 25, 2013 20:39
Android intent/action launch on Android
AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject jo = jc.GetStatic<AndroidJavaObject>("currentActivity");
AndroidJavaObject pm = jo.Call<AndroidJavaObject>("getPackageManager");
AndroidJavaObject intent = pm.Call<AndroidJavaObject>("getLaunchIntentForPackage", "com.x.x");
jo.Call("startActivity", intent);
@drawcode
drawcode / ( ͡° ͜ʖ ͡°)
Created February 26, 2013 02:00
( ͡° ͜ʖ ͡°)
( ͡° ͜ʖ ͡°)
@drawcode
drawcode / UnityWebCamTexture.cs
Created March 5, 2013 03:16
Unity WebCamTexture
for( var i = 0 ; i < devices.length ; i++ ) {
if (devices[i].isFrontFacing) {
frontCamName = devices[i].name;
}
else {
backCamName = devices[i].name;
}
}
frontTex = new WebCamTexture(frontCamName, width, height, framesPerSec);
using UnityEngine;
using System.Collections;
namespace UnityAssets
{
public class DualDisplay : MonoBehaviour
{
public Camera mainCamera, controlsCamera;
public bool autoEnable = true;