Skip to content

Instantly share code, notes, and snippets.


Greg Franko gfranko

View GitHub Profile
gfranko / app.js
Created Apr 4, 2013
Method to check if an element is visible. Detects if another element is absolutely positioned on top of it. Should work in IE9+, Firefox 3+, Chrome, and Safari.
View app.js
gfranko / webshot.phantom.js
Created May 30, 2014
node-webshot enhancement
View webshot.phantom.js
// Handle customCSS option
if (typeof options.customCSS === 'string') {
page.evaluate(function(customCSS) {
var style = document.createElement('style');
var text = document.createTextNode(customCSS);
style.setAttribute('type', 'text/css');
document.head.insertBefore(style, document.head.firstChild);
}, options.customCSS);
View replace-accent.js
var accentMap = {
'à': 'a', 'á': 'a', 'â': 'a', 'ã': 'a', 'ä': 'a', 'å': 'a', // a
'ç': 'c', // c
'è': 'e', 'é': 'e', 'ê': 'e', 'ë': 'e', // e
'ì': 'i', 'í': 'i', 'î': 'i', 'ï': 'i', // i
'ñ': 'n', // n
'ò': 'o', 'ó': 'o', 'ô': 'o', 'õ': 'o', 'ö': 'o', 'ø': 'o', // o
'ß': 's', // s
'ù': 'u', 'ú': 'u', 'û': 'u', 'ü': 'u', // u
'ÿ': 'y' // y
View Front-End Blog Post Ideas
1. Creating Maintainable JavaScript Libraries with AMDClean
2. Backbone.js Custom Builds
3. Grunt or Gulp?
4. Web Components & Polymer
5. The Future of jQuery Plugins - A Web Components Story
View 2014 Open-Source To-Do List
1. Release AMDClean.js v0.4.0:
a. Remove all `require` methods that contain empty function declarations
b. Implement Gulp.js as the build system
2. Create Gulp Plugins:
a. Jasmine-Node
3. Release DownloadBuilder.js v0.8.0:
a. Support Require.js build configurations with the r.js web builder
b. Support built-in minification with the uglify.js web minifier
gfranko / example.js
Last active Dec 19, 2015
Ember.js Views - It would be amazing if Ember Views would allow you to pass an events object of key/value event delegation mappings (similar to Backbone Views). Right now you have to use conditional checking, create more granular Views, or use the action Handlebars helper to trigger custom events.
View example.js
App = Ember.Application.create();
App.ExampleView = Ember.View.extend({
// This removes the whole ugly checking
events: {
'.example click': function() {
console.log('an example image was clicked!');
gfranko / jquery.ui.widget.js
Created Feb 10, 2013
AMD Compatible jQueryUI Widget Factory
View jquery.ui.widget.js
/*! jQuery UI - v1.10.0 - 2013-02-10
* Includes: jquery.ui.widget.js
* Copyright (c) 2013 jQuery Foundation and other contributors Licensed MIT */
;(function (widgetFactory) {
if (typeof define === "function" && define.amd) {
// AMD. Register as an anonymous module.
define("jquery.ui.widget", ["jquery"], function() {
gfranko /
Last active Oct 12, 2015
Backbone-Require-Boilerplate (BRB) Mobile and Desktop Build Configuration with almond.js
// Node.js - Require.js Build Script
// To run the build type the following: node
// Loads the Require.js Optimizer
var requirejs = require('../public/js/libs/r.js');
// Sets up the basic configuration
var baseConfig = {
View Command Line Error Log
$ jitsu deploy
info: Welcome to Nodejitsu gregfranko
info: jitsu v0.10.4, node v0.8.9
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing application dependencies in server.js
warn: Local package version appears to be old
warn: The package.json version will be incremented automatically
warn: About to write /Users/gregfranko/OS/FantasyMMA/package.json
gfranko / replayYouTubeVideo.js
Last active Aug 29, 2015
Replay YouTube Video
View replayYouTubeVideo.js
(function replayYouTubeVideo() {
var video = document.querySelector('.html5-main-video');
setInterval(function() {
if(video.currentTime === video.duration) {
video.currentTime = 0;
}, 5000);
You can’t perform that action at this time.