Skip to content

Instantly share code, notes, and snippets.


James M. Greene JamesMGreene

View GitHub Profile
JamesMGreene / gist:ec88338f047db436a1865aae23af83fd
Created Nov 17, 2017 — forked from kitek/gist:1579117
NodeJS create md5 hash from string
View gist:ec88338f047db436a1865aae23af83fd
var data = "do shash'owania";
var crypto = require('crypto');

Looking for workshop teachers to teach on the following topics!

For introductions please tweet @frontendmasters, @1marc or email: marc at Thanks!

You can propose other topics too.

Published blog post detailing topics and allowed people to vote on priority: 2016 Frontend Masters topic poll

Bolded topics are very highly requested.

#version details
#download binaries
mkdir -p "$PREFIX" && \
JamesMGreene / qunit.pending.js
Last active Jan 4, 2016 — forked from Potherca/qunit.testSkip.js
Duck-punch the `QUnit.test` method to support Mocha-style "pending" tests. UPDATE: As of QUnit v1.16.0, `QUnit.skip` will be a core part of the framework.
View qunit.pending.js
/*global QUnit, window, global */
(function (QUnit, global) {
'use strict';
var document = global && global.document;
var pendingTestIds = [];
var QUnit_test = QUnit.test;
QUnit.test = function(testName, expected, callback, async) {
View clipboard.js
var btn = document.getElementById("copy-button");
btn.addEventListener("click", clickHandler, false);
function clickHandler(e) {
var clip = new ClipboardEvent("copy");
clip.clipboardData.setData("text/plain", "foo");
clip.clipboardData.setData("text/html", "<b>foo</b>");
// CRITICAL: Must call `preventDefault();` to get this data into the system/desktop clipboard!!!
JamesMGreene / vs2012_fix.patch
Created Mar 22, 2013 — forked from vitallium/vs2012_fix.patch
Patch to fix PhantomJS build when running with VS2012
View vs2012_fix.patch
diff --git a/src/qt/src/3rdparty/webkit/Source/JavaScriptCore/wtf/HashSet.h b/src/qt/src/3rdparty/webkit/Source/JavaScriptCore/wtf/HashSet.h
index 82245f3..932d254 100644
--- a/src/qt/src/3rdparty/webkit/Source/JavaScriptCore/wtf/HashSet.h
+++ b/src/qt/src/3rdparty/webkit/Source/JavaScriptCore/wtf/HashSet.h
@@ -175,18 +175,20 @@ namespace WTF {
template<typename T, typename U, typename V>
- inline pair<typename HashSet<T, U, V>::iterator, bool> HashSet<T, U, V>::add(const ValueType& value)
+ inline pair<typename HashSet<T,U,V>::const_iterator, bool> HashSet<T,U,V>::add(const ValueType &value)
View print_gollum.js
View AMD-factory-with-require.js
// Typical AMD factory that returns a value, but uses an r-value (sync) require(),
// rather than a long, awkward dependency list.
// You cannot use module.exports or exports to declare the module:
(function (define){
define(function (require) {
"use strict";
var mod = require('pkb/modA');
return {
JamesMGreene / shot.js
Created Oct 21, 2012 — forked from ahomu/shot.js
Create slides(Reveal.js) PNG images using phantomjs
View shot.js
console.log('Loading a web page');
var page = require('webpage').create();
var url = 'http://localhost:1947/';
page.viewportSize = {
width: 1024,
height: 768
};, function (status) {
//Page is loaded!
var iz, i = 0, queue = {};