Skip to content

Instantly share code, notes, and snippets.

View trozdol's full-sized avatar
💭
All the good repos are private

Shayne Trosdahl trozdol

💭
All the good repos are private
View GitHub Profile
@paulirish
paulirish / bling.js
Last active May 2, 2026 11:52
bling dot js
/* bling.js */
window.$ = document.querySelector.bind(document);
window.$$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); };
NodeList.prototype.__proto__ = Array.prototype;
NodeList.prototype.on = function(name, fn) { this.forEach((elem) => elem.on(name, fn)); };
@trozdol
trozdol / ExampleController.js
Created April 7, 2015 14:17
Sencha Touch Controller Refs Example
/*
* Sencha Touch Controller Refs Example
* Author: Shayne Trosdahl - @Trozdol
* Description: Here's some ref examples. It's not all or the only ways to this.
*/
Ext.define(AppName.controller.ControllerName, {
extend: 'Ext.app.Controller',
@trozdol
trozdol / Sencha-Cordova-CSS-Statusbar-Fix
Last active August 29, 2015 14:06
Sencha Touch + Cordova / PhoneGap Status Bar CSS Only Fix
/*=================================
THIS IS THE STATUSBAR FIX FOR IOS
WHEN THE USER AGENT IS IOS, 2OPT
BOX IS ADDED TO THE TOP OF THE APP.
THIS SHOULD GO IN THE HEAD OF
THE INDEX.HTML INSIDE SCRIPT TAGS
BEFORE THE CLOSEING </HEAD> TAG
===================================*/
@jcsrb
jcsrb / gist:1081548
Created July 13, 2011 23:05
get avatar from google profiles, facebook, gravatar, twitter, tumblr
function get_avatar_from_service(service, userid, size) {
// this return the url that redirects to the according user image/avatar/profile picture
// implemented services: google profiles, facebook, gravatar, twitter, tumblr, default fallback
// for google use get_avatar_from_service('google', profile-name or user-id , size-in-px )
// for facebook use get_avatar_from_service('facebook', vanity url or user-id , size-in-px or size-as-word )
// for gravatar use get_avatar_from_service('gravatar', md5 hash email@adress, size-in-px )
// for twitter use get_avatar_from_service('twitter', username, size-in-px or size-as-word )
// for tumblr use get_avatar_from_service('tumblr', blog-url, size-in-px )
// everything else will go to the fallback
// google and gravatar scale the avatar to any site, others will guided to the next best version