Skip to content

Instantly share code, notes, and snippets.

View codeBelt's full-sized avatar
💭
I may be slow to respond.

Robert S. codeBelt

💭
I may be slow to respond.
View GitHub Profile
@codeBelt
codeBelt / addEventListenerRemoveEventListenerScopeFix
Last active December 20, 2015 12:29
addEventListener and removeEventListener scope polyfill. Not fully tested in all browsers.
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="polyfill.addEventListener.js"></script>
<script>
window.onload = function() {
(function() {
var Test = function() {
this.link = document.getElementById('js-link');
@codeBelt
codeBelt / StructureTS-addEventListener-removeEventListener-Scope-polyfill
Last active December 20, 2015 12:38
StructureTS addEventListener and removeEventListener scope polyfill. Not fully tested in all browsers.
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="polyfill.addEventListener.js"></script>
<script>
window.onload = function() {
(function() {
var Test = function() {
this.link = document.getElementById('js-link');
<!-- Start of Brightcove Player -->
<script language="JavaScript" type="text/javascript" src="http://admin.brightcove.com/js/BrightcoveExperiences.js"></script>
<object id="myExperience921449663001" class="BrightcoveExperience">
<param name="bgcolor" value="#FFFFFF" />
<param name="width" value="480" />
<param name="height" value="270" />
<param name="playerID" value="2079935931001" />
<param name="playerKey" value="AQ~~,AAAA1oy1bvE~,ALl2ezBj3WE0z3yX6Xw29sdCvkH5GCJv" />
<param name="isVid" value="true" />
@codeBelt
codeBelt / bubble.html
Created September 4, 2013 03:56
HTML to show event bubbling.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="css/style.css" media="screen" type="text/css"/>
</head>
<body>
@codeBelt
codeBelt / SignalTest.ts
Created September 19, 2013 03:31
TypeScript Signal Test
///<reference path='com/millermedeiros/signals/Signal.ts'/>
import Signal = millermedeiros.Signal;
/**
* YUIDoc_comment
*
* @class SignalTest
* @constructor
**/
class SignalTest {
@codeBelt
codeBelt / jquery.addEventListener.js
Last active December 25, 2015 08:19
jquery.addEventListener.js
(function ($, window, document)
{
/**
* @version 0.3.0
*/
/**
* A bind polyfill for browsers that don't support the bind method.
*/
if (!Function.prototype.bind) {
@codeBelt
codeBelt / space-regex
Created October 22, 2013 21:15
Regex used in PhpStorm to replace a space character with underscore that has a character before and after it.
([\w])( )+([\w])
$1_$3
@codeBelt
codeBelt / .htaccess
Created October 30, 2013 15:05
Prevents Application Cache Manifest from being cached in the browser.
AddType text/cache-manifest .appcache
<FilesMatch "\.appcache$">
FileETag None
<ifModule mod_headers.c>
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</ifModule>
@codeBelt
codeBelt / unionHash.js
Created November 26, 2013 17:37
JavaScript Hash union.
var arrayOfProperties = [
'admin',
'user',
'anon'
];
var hash = {
admin: "Admin",
user: "user",
superadmin: 'SuperAdmin'
@codeBelt
codeBelt / GridLayout.js
Last active December 31, 2015 06:59
Grid layout loop.
for(var col:number = 0; col < this.NUM_COLUMNS; col++) {
for(var row:number = 0; row < this.NUM_ROWS; row++) {
console.log("col", col, "row", row);
}
}