Skip to content

Instantly share code, notes, and snippets.

@cmarkle27
cmarkle27 / designer.html
Created September 17, 2014 17:43
designer
<link rel="import" href="../chart-js/chart-js.html">
<link rel="import" href="../cool-clock/cool-clock.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
@cmarkle27
cmarkle27 / gist:9209181
Created February 25, 2014 13:54
RBGtoRGBA
function RGBtoRGBA(red, green, blue) {
if ((green === void 0) && (typeof red === 'string')) {
red = red.replace(/^\s*#|\s*$/g, '');
if (red.length == 3) {
red = red.replace(/(.)/g, '$1$1');
}
green = parseInt(red.substr(2, 2), 16);
blue = parseInt(red.substr(4, 2), 16);
red = parseInt(red.substr(0, 2), 16);
}
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[add your bin description]" />
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
</body>
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
</body>
</html>
@cmarkle27
cmarkle27 / Modernizr conditional loading
Created November 16, 2012 12:40 — forked from nternetinspired/Modernizr conditional loading
Conditional resource loading, using Modernizr's yepnope tests, based on viewport size. Placed immediately before the closing head tag in index.php this can be used to load specific resources against reported viewport sizes
<!-- Something like this -->
<script>
Modernizr.load({
test: Modernizr.mq('(min-width:400px)'),
yep: '<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/js/not-small-screen-stuff.js">',
});
</script>
<!-- Or -->
<script>
@cmarkle27
cmarkle27 / modernizr-tests.js
Created November 16, 2012 12:39 — forked from danott/modernizr-tests.js
Custom Modernizr tests that are useful.
/* modernizr-test.js
* Daniel Ott
* 3 March 2011
* Custom Tests using Modernizr's addTest API
*/
/* iOS
* There may be times when we need a quick way to reference whether iOS is in play or not.
* While a primative means, will be helpful for that.
*/
@cmarkle27
cmarkle27 / .tmux.conf
Created October 22, 2012 12:48 — forked from wridgers/.tmux.conf
tmux config file
# Make it use C-a, similar to screen..
unbind C-b
unbind l
set -g prefix C-a
bind-key C-a last-window
# Reload key
bind r source-file ~/.tmux.conf
set -g history-limit 1000
@cmarkle27
cmarkle27 / .tmux.clipboard
Created October 19, 2012 15:48 — forked from napcs/.tmux.clipboard
My tmux config
# configuration for osx clipboard support
set-option -g default-command "reattach-to-user-namespace -l sh"
@cmarkle27
cmarkle27 / class-prototype.js
Created August 18, 2012 14:48
Resig Class Prototype
// makeClass - By John Resig (MIT Licensed)
function makeClass(){
return function(args){
if ( this instanceof arguments.callee ) {
if ( typeof this.init == "function" )
this.init.apply( this, args.callee ? args : arguments );
} else
return new arguments.callee( arguments );
};
}
@cmarkle27
cmarkle27 / jquery.click-counter.plugin.js
Created August 10, 2012 19:27
ClickCounter jQuery Plugin
/**
* clickCounter Plugin
* counts clicks
*
* @events: "panel-loader-clicked", "panel-loader-complete"
* @requirements: jQuery 1.7, bbq
* @author: Chris Markle
*
*/
(function($) {