Skip to content

Instantly share code, notes, and snippets.

@internoma
internoma / 0_reuse_code.js
Created April 25, 2016 10:46
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@internoma
internoma / jQuery Plugin Design Pattern
Created June 14, 2016 21:37 — forked from keelii/jQuery Plugin Design Pattern
The Best jQuery Plugin Design Pattern ...
/*!
* from: http://stackoverflow.com/questions/7127600/which-jquery-plugin-design-pattern-should-i-use
*/
(function ($) {
// the constructor
var MyClass = function (node, options) {
// node is the target
this.node = node;
@internoma
internoma / ie67891011-css-hacks.txt
Created June 28, 2016 09:35 — forked from ricardozea/ie67891011-css-hacks.txt
IE CSS hacks - IE6, 7, 8, 9, 10, 11
IE6 Only
==================
_selector {...}
IE6 & IE7
==================
*html or { _property: }
IE7 Only
==================
@internoma
internoma / development.js
Created July 4, 2016 20:15 — forked from leosuncin/development.js
Configure livereload support to sails.js
// config/env/development.js
/**
* Development environment settings
*
* This file can include shared settings for a development team,
* such as API keys or remote database passwords. If you're using
* a version control solution for your Sails app, this file will
* be committed to your repository unless you add it to your .gitignore
* file. If your repository will be publicly viewable, don't add
* any private information to this file!
@internoma
internoma / mongo-autostart-osx.md
Created July 15, 2016 21:25 — forked from subfuzion/mongo-autostart-osx.md
mongo auto start on OS X

Install with Homebrew

brew install mongodb

Set up launchctl to auto start mongod

$ ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents

/usr/local/opt/mongodb/ is a symlink to /usr/local/Cellar/mongodb/x.y.z (e.g., 2.4.9)

@internoma
internoma / showAsPrint.js
Created March 26, 2019 11:56 — forked from jscher2000/showAsPrint.js
Emulate print media in Firefox 62 (userscript work in progress)
// For Firefox's Web Console, creates the functions showAsPrint() and undoShowAsPrint()
// to roughly emulate print media and revert
function showAsPrint(){
var docSS = document.styleSheets, ss, oldMedia, newMedia, rules;
var p2s = function(media){
if (media.indexOf('all') > -1) return media; //no need to change
if (media == 'print') return 'all, wasprint'; //show on screen, too
if (media.indexOf('print') > -1 && media.indexOf('screen') > -1) return media; //no need to change
if (media == 'screen') return 'wasscreen'; //hide these rules
if (media.indexOf('screen') > -1) return media.replace('screen', 'wasscreen'); //hide these rules