d3js: Create an HTML table using d3.js and JSON
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
Backbone.syncWithoutUpload = Backbone.sync | |
Backbone.syncWithUpload = function(method, model, options) { | |
// Create iframe | |
var iframe_id = 'file_upload_iframe_' + Date.now() | |
, iframe = jQuery('<iframe id="' + iframe_id + '" name="' + iframe_id + '" ></iframe>').hide() | |
// Create an hidden form | |
var authToken = jQuery('meta[name=csrf-token]').attr('content') | |
, authParam = jQuery('meta[name=csrf-param]').attr('content') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp') | |
, jshint = require('gulp-jshint') | |
, csslint = require('gulp-csslint') | |
, sass = require('gulp-sass') | |
, gconcat = require('gulp-concat') | |
, uglify = require('gulp-uglify') | |
, rename = require('gulp-rename') | |
, ngmin = require('gulp-ngmin') | |
, gzip = require('gulp-gzip') | |
, jade = require('gulp-jade') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# bash completion for rake | |
# | |
# some code from on Jonathan Palardy's http://technotales.wordpress.com/2009/09/18/rake-completion-cache/ | |
# and http://pastie.org/217324 found http://ragonrails.com/post/38905212/rake-bash-completion-ftw | |
# | |
# For details and discussion | |
# http://turadg.aleahmad.net/2011/02/bash-completion-for-rake-tasks/ | |
# | |
# INSTALL | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Bash completion for Yeoman generators - tested in Ubuntu, OS X and Windows (using Git bash) | |
function _yo_generator_complete_() { | |
# local node_modules if present | |
local local_modules=$(if [ -d node_modules ]; then echo "node_modules:"; fi) | |
# node_modules in /usr/local/lib if present | |
local usr_local_modules=$(if [ -d /usr/local/lib/node_modules ]; then echo "/usr/local/lib/node_modules:"; fi) | |
# node_modules in user's Roaming/npm (Windows) if present | |
local win_roam_modules=$(if [ -d $(which yo)/../node_modules ]; then echo "$(which yo)/../node_modules:"; fi) | |
# concat and also add $NODE_PATH | |
local node_dirs="${local_modules}${usr_local_modules}${win_roam_modules}${NODE_PATH}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.citytechinc.rewriter.linkchecker; | |
import java.io.IOException; | |
import org.apache.cocoon.xml.sax.AbstractSAXPipe; | |
import org.apache.sling.rewriter.ProcessingComponentConfiguration; | |
import org.apache.sling.rewriter.ProcessingContext; | |
import org.apache.sling.rewriter.Transformer; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.crypto.*; | |
import javax.crypto.spec.GCMParameterSpec; | |
import java.nio.ByteBuffer; | |
import java.security.SecureRandom; | |
import java.util.Arrays; | |
public class AESGCMUpdateAAD2 { | |
// AES-GCM parameters | |
public static final int AES_KEY_SIZE = 128; // in bits |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# configuration for osx clipboard support | |
set-option -g default-command "reattach-to-user-namespace -l sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.concurrent.Callable; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Future; | |
import java.util.concurrent.LinkedBlockingQueue; | |
import java.util.concurrent.ThreadPoolExecutor; | |
import java.util.concurrent.TimeUnit; | |
public class FuturesA { | |
public static void run() throws Exception { |
The final result: require() any module on npm in your browser console with browserify
This article is written to explain how the above gif works in the chrome (and other) browser consoles. A quick disclaimer: this whole thing is a huge hack, it shouldn't be used for anything seriously, and there are probably much better ways of accomplishing the same.
Update: There are much better ways of accomplishing the same, and the script has been updated to use a much simpler method pulling directly from browserify-cdn. See this thread for details: mathisonian/requirify#5
OlderNewer