Skip to content

Instantly share code, notes, and snippets.

View goofmint's full-sized avatar

Atsushi goofmint

View GitHub Profile
@goofmint
goofmint / gist:1625495
Created January 17, 2012 07:43
jQ.Mobi ajax calls
.get(url,callback);
.ajax {
type:'POST', //defaults to GET
url:'/api/getinfo', //defaults to window.location
contentType:'application/json', //defaults to application/x-www-form-urlencoded
headers:{},
dataType:'application/json', //defaults to text/html
data:{username:foo}, //Can be a Key/Value pair string or object. If it's an object, $.serialize is called to turn it into a Key/Value pair string
success:function(data){}, //function to call on successful Ajax request
error:function(data){}, //function to call when an error exists in the Ajax request
@goofmint
goofmint / gist:1625497
Created January 17, 2012 07:44
jQ.Mobi OS detectors
$.os.webkit //True if webkit found in the user agent
$.os.android //True if anroid useragent
$.os.ipad //True if iPad useragent
$.os.iphone //True if iPhone user agent
$.os.webos //True if WebOS detected
$.os.touchpad //True if WebOS and Touchpad user agent
$.os.ios //True if iPad or iPhone
$.os.blackberry //True if Blackberry PlayBook or OS >=6
@goofmint
goofmint / gist:1638631
Created January 19, 2012 07:47
AngularJS demo
/* http://docs.angularjs.org/#!angular.service */
/**
* App service which is responsible for the main configuration of the app.
*/
angular.service('myAngularApp', function($route, $location, $window) {
$route.when('/view1', {template: 'partials/partial1.html', controller: MyCtrl1});
$route.when('/view2', {template: 'partials/partial2.html', controller: MyCtrl2});
@goofmint
goofmint / gist:1661143
Created January 23, 2012 06:21
uibutton default
<a class="uibutton" href="#">Button</a>
<button class="uibutton" type="submit">Button</button>
<input class="uibutton" type="submit" value="Button">
@goofmint
goofmint / gist:1661148
Created January 23, 2012 06:22
CSS3 Facebook button Large
<a class="uibutton large" href="#">Search</a>
@goofmint
goofmint / gist:1661149
Created January 23, 2012 06:23
CSS3 Facebook buttons Group
<div class="uibutton-group">
<a class="uibutton" href="#">Dashboard</a>
<a class="uibutton" href="#">Inbox</a>
<a class="uibutton" href="#">Account</a>
<a class="uibutton" href="#">Logout</a>
</div>
<ul class="uibutton-group">
<li><a class="uibutton" href="#">Dashboard</a></li>
<li><a class="uibutton" href="#">Inbox</a></li>
@goofmint
goofmint / gist:1661153
Created January 23, 2012 06:23
Mix group
<div class="uibutton-toolbar">
<a class="uibutton" href="#">Mark as unread</a>
<div class="uibutton-group">
<a class="uibutton" href="#">Report spam</a>
<a class="uibutton" href="#">Delete</a>
</div>
<a class="uibutton" href="#">Unsubscribe</a>
</div>
@goofmint
goofmint / gist:1661155
Created January 23, 2012 06:24
Button with icon
<a class="uibutton icon add" href="#">New message</a>
@goofmint
goofmint / gist:1668282
Created January 24, 2012 05:59
andlog
localStorage.debug = true
@goofmint
goofmint / gist:1674445
Created January 25, 2012 03:10
Arctic.js class
var Person = arc.Class.create({
_name:null,
initialize: function(name) {
this.setName(name);
},
setName: function(name){
this._name = name;
},