Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#
# Initialize new virtual server using LXC and set up networking and HTTP proxy
#
# Written by: Deni Bertovic <deni.bertovic@dobarkod.hr>
#
# Released into Public Domain. You may use, modify and distribute it as you
# see fit.
#
# This script will:
@badsyntax
badsyntax / index.md
Created September 1, 2014 08:38 — forked from mathisonian/index.md

demo gif

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.

inspiration

My inspiration for building this was Max Ogden's Requirebin, which allows users to use a browser based editor to run custom javascript in the browser (including javascript that had require() statements that would normally need to be pre-processed using browserify).

/*
* jQuery DropNice Plugin
* http://github.com/shadowhand/jquery-dropnice
*
* Copyright (c) 2010 Woody Gilk <woody@wingsc.com>
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
<!DOCTYPE html>
<!-- Helpful things to keep in your <head/>
// Brian Blakely, 360i
// http://twitter.com/brianblakely/
-->
<head>
<!-- According to Heather Champ, former community manager at flickr,
you should not allow search engines to index your "Contact Us"
/*!
* $.preload() function for jQuery
* Preload images, CSS and JavaScript files without executing them
* Script by Stoyan Stefanov – http://www.phpied.com/preload-cssjavascript-without-execution/
* Slightly rewritten by Mathias Bynens – http://mathiasbynens.be/
* Demo: http://mathiasbynens.be/demo/javascript-preload
* Note that since this script relies on jQuery, the preloading process will not start until jQuery has finished loading.
*/
$.extend({
@badsyntax
badsyntax / gist:778734
Created January 13, 2011 22:20 — forked from k33g/gist:778460
function Human(){
var that = this;
var name="John Doe";
that.getName=function(){return name;}
that.setName=function(value){name=value;}
return that;
}
function Man(){
git init
git submodule add git://github.com/kohana/core.git system
git submodule add git://github.com/kohana/database.git modules/database
git submodule add git://github.com/kohana/userguide.git modules/userguide
git submodule add git://github.com/kohana/image.git modules/image
git submodule add git://github.com/kohana/codebench.git modules/codebench
git submodule add git://github.com/kohana/auth.git modules/auth
git submodule add git://github.com/kohana/pagination.git modules/pagination
git submodule add git://github.com/kohana/orm.git modules/orm
@badsyntax
badsyntax / KohanaForumHideRussian.user.js
Created January 11, 2012 13:24 — forked from evopix/KohanaForumHideRussian.user.js
A Chrome UserScript to hide all Russian threads on Kohana's forum.
// ==UserScript==
// @name KohanaForumHideRussian
// @description Hide Russian threads from Kohana forum.
// @include *forum.kohanaframework.*
// ==/UserScript==
! function(){
var items = document.querySelectorAll('ul.DataList li.Item');
// In Chrome Canary, with Experimental JavaScript enabled...
(function( exports ) {
// Create a reusable symbol for storing
// Emitter instance events
var sym = new Symbol();
function Emitter() {
this[ sym ] = {
@badsyntax
badsyntax / a.md
Last active December 18, 2015 04:48 — forked from padolsey/a.md