Solution to https://twitter.com/nolanlawson/status/578948854411878400.
doSomething().then(function () {Solution to https://twitter.com/nolanlawson/status/578948854411878400.
doSomething().then(function () {| (ns localstorage) | |
| (defn set-item! | |
| "Set `key' in browser's localStorage to `val`." | |
| [key val] | |
| (.setItem (.-localStorage js/window) key val)) | |
| (defn get-item | |
| "Returns value of `key' from browser's localStorage." | |
| [key] |
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
| #cVim-link-container, .cVim-link-hint, #cVim-command-bar, #cVim-command-bar-mode, #cVim-command-bar-input, #cVim-command-bar-search-results, .cVim-completion-item, .cVim-completion-item .cVim-full, .cVim-completion-item .cVim-left, .cVim-completion-item .cVim-right, #cVim-hud, #cVim-status-bar { | |
| font-family: Helvetica, Helvetica Neue, Neue, sans-serif, Arial; | |
| font-size: 9pt !important; | |
| -webkit-font-smoothing: antialiased !important; | |
| border-radius: 4px!important; | |
| } | |
| #cVim-link-container { | |
| position: absolute; | |
| pointer-events: none; |
| Windows Registry Editor Version 5.00 | |
| [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout] | |
| "Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00 |
| #!/bin/bash | |
| # only works atm if only one jdk package in downloads | |
| DOWNLOADS=$HOME/Downloads | |
| CURRENT_VERSION=$(java -version 2>&1) | |
| JDK=` ls $DOWNLOADS | grep "jdk"` | |
| STUDIO_URL=http://dl.google.com/android/studio/install/0.3.2/android-studio-bundle-132.893413-linux.tgz | |
| if [ "uname -m" == "i386" -o "uname -m" == "i686" ]; then | |
| ARCH=32 | |
| else |
| #!/usr/bin/env python | |
| """strip outputs from an IPython Notebook | |
| Opens a notebook, strips its output, and writes the outputless version to the original file. | |
| Useful mainly as a git filter or pre-commit hook for users who don't want to track output in VCS. | |
| This does mostly the same thing as the `Clear All Output` command in the notebook UI. | |
| LICENSE: Public Domain |
| // Original method | |
| var object = { | |
| method: function (x, y) { | |
| return x+y; | |
| } | |
| } | |
| // Add operations before or after! | |
| object.method = (function (original) { | |
| return function (x, y) { |
| #/bin/bash | |
| #-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password | |
| REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'` | |
| if [ -z "$REPO_URL" ]; then | |
| echo "-- ERROR: Could not identify Repo url." | |
| echo " It is possible this repo is already using SSH instead of HTTPS." | |
| exit | |
| fi |