Skip to content

Instantly share code, notes, and snippets.

Mx Corey Frang gnarf

Block or report user

Report or block gnarf

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@gnarf
gnarf / test.js
Last active Sep 19, 2015 — forked from tbranyen/test.js
WebComponent Backbone-events like
View test.js
class CustomElement extends HTMLElement {
constructor() {
super();
}
attachedCallback() {
this.bindEvents();
}
detachedCallback() {
View 1-file.txt
foo bar
baz
qux
last line (there may or may not be a trailing newline after this line)
@gnarf
gnarf / jquery deferred api calls.js
Created Oct 31, 2012 — forked from fission6/jquery deferred api calls
complex use case for API calls utilizing jQuery deferreds
View jquery deferred api calls.js
// outer IIFE - gives us $ === jQuery!, also, makes every var/function inside "private"!
window.MYAPI = (function($) {
function processSiteRequest( data ) {
var sites = data.response.sites;
// loop through each site given back for the paginated result set
$.each( sites || [], function(index, site) {
debugPrint("Site: " + site.name);
View main.js
$(document).ready(function(){
function stopprop( event ) { event.stopPropagation(); }
function starhover( event ) {
console.log( event.type );
this.src = ( event.type === "mouseenter" ) ? 'images/stardown.png' : 'images/starup.png';
}
$('#leftTab').on({
// When hovered
View gist:1323953
//based on https://gist.github.com/07a297472f182f7a7132/79d3dea1e3dc7ce2d065a42316b83ec820671634
;(function($, undefined) {
$.notify = function(options) {
if(options.timeOut > 0)
{
//add the timer to the message
console.log($(options.message).find('.countDown'));
if($(options.message).find('.countDown').length > 0){
@gnarf
gnarf / deferreds_pipe
Created Oct 13, 2011 — forked from dmethvin/deferreds_pipe
Use of deferreds and pipe
View deferreds_pipe
fetchCurrentPosition()
.then(updateLocationDisplay)
.pipe(fetchWeatherAtThisLocation)
.then(updateWeatherDisplay)
.pipe(determineWeatherType)
.then(updateRecommendations)
.then(updateAppTile);
function fetchCurrentPosition()
{
View gist:842425
$(document).ready(function(){
function rem(e){
alert("asdfasdf");
};
$("#remove").click(rem);
});
You can’t perform that action at this time.