Skip to content

Instantly share code, notes, and snippets.

View KDawg's full-sized avatar

K KDawg

  • United States
View GitHub Profile
@KDawg
KDawg / gist:3704125
Created September 12, 2012 03:32
Anna Learns to Code With Addition
(function() {
var i;
var value;
var start = 1;
var end = 10;
var by= 1;
value = start;
@KDawg
KDawg / DebugAndoirdWebAppRemote.md
Created October 24, 2012 22:57
Debug Android WebApp Over Remote Chrome from OSX

#Remote debugging USB-connected Android via Chrome

##Phone Setup

  • Requires a handset with modern Android (ala 4.X, etc)
  • settings => developer options => usb debug enable
  • phone => chrome => settings => developer tools => usb debug enable

##Desktop Setup - One Time Only

@KDawg
KDawg / iPhoneRemoteBrowser.md
Created October 31, 2012 15:52
iPhone Web Browser Remote Debug from Desktop

Remote debugging USB-connected iOS6 via Safari

Of course at the end of app development it's bug season. Testing on device is a big deal with some of these problems because they only happen on the resource-restricted device. Testing on device is everything when it's a mobile-specific web app.

In the past we've used various add in tools but with iOS6 it's all built in. Here are some notes helping remote debug from desktop to usb connected phone.

Safari Upgrade and OS X Versions

Safari 6 comes with "Mountain Lion" 10.5, but I'm on "Lion" 10.4 and the Safari upgrade doesn't appear to be automatic – you know how Apple likes to force upgrades. Easily worked-around, however, as Safari6 is hosted on Cnet here: http://download.cnet.com/Apple-Safari/3000-2356_4-34119.html

@KDawg
KDawg / WeinreRemoteDebugging.md
Created November 7, 2012 04:02
Weinre Remote Debugging for Older Phones

Remote debugging USB-connected "older handsets" via Weinre

Download Weinre Binary

@KDawg
KDawg / jasmine_test_boilerplate.js
Created January 23, 2013 21:22
Skeleton poofing a new Jasmine test JS in our TC project world
require(['mediator', 'jquery', 'underscore', 'backbone', 'namespace', 'i18n!common/i18n/nls/strings',
'models/the_feature/some_model', 'views/the_feature/some_view'],
function(mediator, $, _, Backbone, app, t, TheModel, TheView) {
describe('Create Trip View', function() {
var createModel, createView;
beforeEach(function() {
createModel = new Backbone.Model();
createView = new Backbone.View({model: createModel});
@KDawg
KDawg / FB_JS_SDK_ME_RESPONSE.js
Created January 28, 2013 23:03
Facebook JS SDK /me service response
// Simply logging into Facebook via their JavaScript SDK:
FB.login(function(response) {
// assuming a valid response executing this FQL:
FB.api('/me', function(response) {
console.log('me', response);
});
}, {scope: 'email,user_status,user_checkins,user_likes,user_interests,user_location,friends_location'});
// these are the contents of service response as a JS object
@KDawg
KDawg / FB_JS_SDK_FRIEND_RESPONSE.js
Last active December 11, 2015 21:58
Facebook JS SDK /me/friend service response
// Simply logging into Facebook via their JavaScript SDK:
FB.login(function(response) {
// assuming a valid response executing this FQL:
FB.api('/me/friends', function(response) {
console.log('me', response);
});
}, {scope: 'email,user_status,user_checkins,user_likes,user_interests,user_location,friends_location'});
// these are the contents of service response as a JS object
@KDawg
KDawg / FB_JS_SDK_LIKES_RESPONSE.js
Last active December 11, 2015 21:59
Facebook JS SDK /me/likes service response
// Simply logging into Facebook via their JavaScript SDK:
FB.login(function(response) {
// assuming a valid response executing this FQL:
FB.api('/me/likes', function(response) {
console.log('me', response);
});
}, {scope: 'email,user_status,user_checkins,user_likes,user_interests,user_location,friends_location'});
// these are the contents of service response as a JS object
@KDawg
KDawg / FB_JS_SDK_CHECKIN_RESPONSE.js
Created January 29, 2013 21:46
Facebook JS SDK /me/checkins service response
// Simply logging into Facebook via their JavaScript SDK:
FB.login(function(response) {
// assuming a valid response executing this FQL:
FB.api('/me/checkins', function(response) {
console.log('me', response);
});
}, {scope: 'email,user_status,user_checkins,user_likes,user_interests,user_location,friends_location'});
// these are the contents of service response as a JS object
@KDawg
KDawg / gist:10537524
Created April 12, 2014 14:10
Debug Unity3D OnGui Label Text With Background
// display a background texture banner
GUI.DrawTexture(new Rect(-30.0f, 384.0f, m_topScoreBanner.width, m_topScoreBanner.height), m_topScoreBanner);
Vector2 pivotPoint = new Vector2(Screen.width / 2, Screen.height / 2);
GUIStyle scoreStyle = new GUIStyle();
// DEBUG: create a background texture coloring the entire label background
Texture2D debugTex = new Texture2D(1,1);
debugTex.SetPixel(0,0,Color.grey);
debugTex.Apply();