Skip to content

Instantly share code, notes, and snippets.

David Boyer misterdai

View GitHub Profile
View gist:5c0581a1e7c58f324d69c6bebe060b07
{
search(query: "language:JavaScript stars:>100 created:>2017-05-20 sort:stars-asc", type: REPOSITORY, first: 10) {
repositoryCount
edges {
node {
... on Repository {
name
descriptionHTML
stargazers {
totalCount
@misterdai
misterdai / youtube.cfm
Last active Oct 30, 2015
Youtube cfm?
View youtube.cfm
<cfscript>
urls = [
'//www.youtube-nocookie.com/embed/up_lNV-yoK4?rel=0',
'http://www.youtube.com/user/Scobleizer##p/u/1/1p3vcRhsYGo',
'http://www.youtube.com/watch?v=cKZDdG9FTKY&feature=channel',
'http://www.youtube.com/watch?v=yZ-K7nCVnBI&playnext_from=TL&videos=osPknwzXEas&feature=sub',
'http://www.youtube.com/ytscreeningroom?v=NRHVzbJVx8I',
'http://www.youtube.com/user/SilkRoadTheatre##p/a/u/2/6dwqZw0j_jY',
'http://youtu.be/6dwqZw0j_jY',
'http://www.youtube.com/watch?v=6dwqZw0j_jY&feature=youtu.be',
@misterdai
misterdai / youtube.js
Created Oct 29, 2015
Youtube validate and ID grab
View youtube.js
var urls = [
'//www.youtube-nocookie.com/embed/up_lNV-yoK4?rel=0',
'http://www.youtube.com/user/Scobleizer#p/u/1/1p3vcRhsYGo',
'http://www.youtube.com/watch?v=cKZDdG9FTKY&feature=channel',
'http://www.youtube.com/watch?v=yZ-K7nCVnBI&playnext_from=TL&videos=osPknwzXEas&feature=sub',
'http://www.youtube.com/ytscreeningroom?v=NRHVzbJVx8I',
'http://www.youtube.com/user/SilkRoadTheatre#p/a/u/2/6dwqZw0j_jY',
'http://youtu.be/6dwqZw0j_jY',
'http://www.youtube.com/watch?v=6dwqZw0j_jY&feature=youtu.be',
'http://youtu.be/afa-5HQHiAs',
@misterdai
misterdai / README.md
Created Nov 6, 2014
ES6, Traceur, Node.js, Harmony
View README.md
ES6 Feature Node Flag Traceur Flag
generators (yield) --harmony_generators true --generators parse
octal and binary literals --harmony_numeric_literals true --numeric_literals parse
Map, Set, WeakMap, WeakSet --harmony_collections true ???
block-level function declaration ??? ???
Promise Dummy Flag ???
Object.is
@misterdai
misterdai / index.js
Created Jul 16, 2014
metalsmith-permalinks
View index.js
var debug = require('debug')('metalsmith-permalinks');
var moment = require('moment');
var path = require('path');
var slug = require('slug-component');
var substitute = require('substitute');
var basename = path.basename;
var dirname = path.dirname;
var extname = path.extname;
var join = path.join;
View myapp.xml
<service>
<id>nginx</id>
<name>nginx</name>
<description>nginx</description>
<executable>c:\nginx\nginx.exe</executable>
<logpath>c:\nginx\</logpath>
<logmode>roll</logmode>
<depend></depend>
<startargument>-p c:\nginx</startargument>
<stopargument>-p c:\nginx -s stop</stopargument>
@misterdai
misterdai / test.coffee
Created Oct 16, 2013
Considering approaches of laying out code and handling callbacks. Which one would you pick? getData1, getData2 or getData3?... Or some other method?
View test.coffee
request = require 'request'
class Test
_processData: (details, callback, error, response, body) =>
if error?
return callback error
if reponse.statusCode isnt 200
return callback(new Error(response.statusCode))
try
callback null, {data: JSON.parse(body), details: details}
@misterdai
misterdai / application.cfc
Created Nov 21, 2012
Just a test for use within wordpress (oooh that rhymes :P)
View application.cfc
<cfcomponent output="false">
<cffunction name="onError">
<cfargument name="exception" required="true" />
<cfargument name="eventName" type="string" required="true" />
<cfif StructKeyExists(arguments.exception, 'rootcause')
And StructKeyExists(arguments.exception.rootCause, 'type')
And arguments.exception.rootCause.type Eq 'coldfusion.runtime.AbortException'>
<!--- CF7: Work around for CfAbort and CfLocation causing this to run --->
<cfreturn />
</cfif>
@misterdai
misterdai / bookmarklet
Created Sep 19, 2012
Bookmarklet do remove blank code lines and turn comments into tooltips.
View bookmarklet
javascript:(function(){$('.gist .line br').each(function(){if($(this).siblings().length==0){$(this).parent().remove();}});$('.c, .cm, .c1, .cs','.gist').each(function(){var el=$(this);var parent=el.parent();if(el.siblings().length > 0){var comment=parent.attr('data-comment');comment=(typeof comment==='undefined')%3F'':(comment+'\n');parent.attr('data-comment',comment+el.text());el.remove();}else{var nextParent=parent.next();var comment=parent.attr('data-comment');comment=(typeof comment==='undefined')%3F'':(comment+'\n');nextParent.attr('data-comment',comment+el.text());parent.remove();}});$('html > head').append('<style>*[data-comment] {position:relative; background-color:%23dfd;} *[data-comment]:hover {background-color: %23efe;} *[data-comment]:after, *[data-comment]:before {content:""; opacity:0; z-index:999;} *[data-comment]:hover:after, *[data-comment]:focus:after {opacity:0.94; display:block; content:attr(data-comment); position:absolute; bottom:25px; padding:3px; background:%23efe; border:2px solid %23
View filler.js
$('input[type=text],textarea').each(function() {$(this).val(Math.random().toString(36).substring(3))});
$('select').each(function() {
var el = this;
if (el.multiple) {
$('option', el).each(function() {
this.selected = (Math.random() > 0.5);
});
} else {
You can’t perform that action at this time.