Skip to content

Instantly share code, notes, and snippets.

View elijahmanor's full-sized avatar
😀

Elijah Manor elijahmanor

😀
View GitHub Profile
// The previous code could be rewritten as the following
$( ".widget" ).css( "color", "green" );
@elijahmanor
elijahmanor / upfrontpodcast-questions.md
Last active December 11, 2015 20:58
Upfront Podcast Questions
  • Q: Now that you are working for @Telerik on the @KendoUI project will you still be invested in Backbone.js?
  • Q: Will @Telerik or @KendoUI be investing in the Backbone.js OSS community with plugins or tools that are also OSS?
  • Q: Do you plan to continue work on the backbone.marionette project?
  • Q: Will @KendoUI be providing time for you to work on backbone.marionette or will it be on your own time?
@elijahmanor
elijahmanor / embedding-gist-file-broken.md
Last active December 12, 2015 04:28
Embedding a Specific Gist File is Broken

It seems embedding a specific file from a Gist recently broke. Example: https://gist.github.com/4490679.js?file=browser-sniffing.js now embeds all files from the gist instead of just the browser-sniffing.js file. Unfortunately, this breaks a lot of my blog posts.

The URL seems to have changed slightly to include the GitHub username in the URL to support embedding one file like https://gist.github.com/elijahmanor/4490679.js?file=browser-sniffing.js

I was able to update some of my posts, but I hope GitHub will support both ways. Was this behavior change an accident or on purpose? Anyone know?

Are there plans to add backwards compatibility? Where would I post this as a bug?

@elijahmanor
elijahmanor / backbone-sync-override.js
Created February 8, 2013 18:35
Overriding Backbone.sync to POST instead of PUT/DELETE/PATCH
// The following could have been replaced by setting `Backbone.emulateHTTP = true;`
Backbone._sync = Backbone.sync;
Backbone.sync = function( method, model, options ) {
var beforeSend = options.beforeSend;
options = options || {};
if ( method === "update" || method === "delete" || method === "patch" ) {
options.beforeSend = function( xhr ) {
@elijahmanor
elijahmanor / javascript-tidbits.md
Last active December 12, 2015 10:19
Extraneous JavaScript Tidbits

Dangers of the Boolean Wrapper

var falseBoolean = new Boolean( false );
if ( falseBoolean ) {
    console.log( "Hey, I'm false... what up with this!?!" );
}

JavaScript Conversion Techniques

@elijahmanor
elijahmanor / custom-array-like-object.js
Last active August 9, 2023 12:10
jQuery Array-like Object
var array_like = {};
array_like[ 0 ] = "test 0";
array_like[ 1 ] = "test 1";
array_like[ 2 ] = "test 2";
array_like[ 3 ] = "test 3";
array_like.length = 4;
array_like.splice = [].splice;
@elijahmanor
elijahmanor / jquery.qrify.js
Last active December 13, 2015 17:48
jQuery QRify Plugin
// BEGIN jquery.qrify.js
(function( $ ) {
$.fn.qrify = function( options ) {
options = $.extend( {}, $.fn.qrify.defaultOptions, options );
return this.each( function() {
var $anchor = $( this ),
source = "//chart.googleapis.com/chart?chs=" +
options.width + "x" + options.height +
"&cht=qr&chld=|0&chl=";
@elijahmanor
elijahmanor / empty-iife.js
Last active December 13, 2015 23:19
Angry Birds of JavaScript Development: Red Bird
// JavaScript can parse this just fine now, yay!
(function() {
// All memory is contained within this scope
}()); // <-- Immediately Invoked
@elijahmanor
elijahmanor / fiddle.html
Last active December 14, 2015 02:09
jQuery Event Binding: Click/Bind
<div data-role="page">
<div data-role="header">
<h1>jQuery Board Members</h1>
</div>
<div data-role="content">
<ul id="members" data-role="listview" data-filter="true">
<li>
<a href="index.html">
@elijahmanor
elijahmanor / alarm-clock.js
Created March 1, 2013 15:35
JavaScript Alarm Clock
setInterval( 86400000, function () {
var day = new Date().getDay();
if ( day === 0 || day === 6 ) {
return;
}
alert( "Wake up!" );
});