Skip to content

Instantly share code, notes, and snippets.

{
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 October 30, 2015 11:39
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 October 29, 2015 16:03
Youtube validate and ID grab
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 November 6, 2014 08:29
ES6, Traceur, Node.js, Harmony
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 July 16, 2014 09:23
metalsmith-permalinks
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;
@misterdai
misterdai / myapp.xml
Created February 6, 2014 10:29
nginx 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 October 16, 2013 11:01
Considering approaches of laying out code and handling callbacks. Which one would you pick? getData1, getData2 or getData3?... Or some other method?
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 November 21, 2012 10:17
Just a test for use within wordpress (oooh that rhymes :P)
<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 September 19, 2012 13:59
Bookmarklet do remove blank code lines and turn comments into tooltips.
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
@misterdai
misterdai / filler.js
Created July 31, 2012 14:44
Form filler
$('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 {