Skip to content

Instantly share code, notes, and snippets.

View illusionfield's full-sized avatar

Hoffy illusionfield

View GitHub Profile

OS X Preferences


#Disable window animations
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false

#Enable repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
@illusionfield
illusionfield / bower.json
Created March 12, 2015 20:10
extend overrides meteor-bower
{
"name": "App",
"version": "0.0.1",
"private": "true",
"dependencies": {
"foundation": "zurb/bower-foundation#master",
"foundation-icon-fonts": "master",
"lodash": "master",
"modernizr": "*",
"microplugin": "*",
@illusionfield
illusionfield / package.js
Created March 28, 2015 13:45
particle4dev:sass@2.0.1_1 win
Package.describe({
summary: "SASS for meteor",
version: "2.0.1_1",
name: "particle4dev:sass",
git: "https://github.com/particle4dev/meteor-sass.git"
});
Package.onUse(function (api) {
api.versionsFrom('METEOR@1.1-rc.0');
});
@illusionfield
illusionfield / bower.json
Last active August 29, 2015 14:19
Meteor bower error
{
"name": "App",
"version": "0.0.1",
"private": "true",
"dependencies": {
"foundation": "*",
"lodash": "master",
"modernizr": "*",
"microplugin": "*",
"underscore.string": "master",
@illusionfield
illusionfield / bookmarklet-syntax.js
Last active May 16, 2024 12:32
Translate Bookmarklets
/**
* Web browsers use URIs for the href attribute of the <a> tag and for bookmarks. The URI scheme, such as http:, file:, or ftp:, specifies the protocol and the format for the rest of the string.
* Browsers also implement a prefix javascript: that to a parser is just like any other URI.
* Internally, the browser sees that the specified protocol is javascript, treats the rest of the string as a JavaScript application which is then executed, and uses the resulting string as the new page.
*
* The executing script has access to the current page, which it may inspect and change.
* If the script returns an undefined type (rather than, for example, a string), the browser will not load a new page, with the result that the script simply runs against the current page content.
* This permits changes such as in-place font size and color changes without a page reload.
*/
// Get the template HTML and remove it from the doumenthe template HTML and remove it from the doument
var previewNode = document.querySelector("#template");
previewNode.id = "";
var previewTemplate = previewNode.parentNode.innerHTML;
previewNode.parentNode.removeChild(previewNode);
var myDropzone = new Dropzone(document.body, { // Make the whole body a dropzone
url: "/target-url", // Set the url
thumbnailWidth: 80,
thumbnailHeight: 80,
@illusionfield
illusionfield / Sync_Async_loading_handlebars.js
Created October 17, 2015 22:19 — forked from utsengar/Sync_Async_loading_handlebars.js
synchronous and asynchronous loading of handlebars templates
/*
* This decorates Handlebars.js with the ability to load
* templates from an external source, with light caching.
*
* To render a template, pass a closure that will receive the
* template as a function parameter, eg,
* T.render('templateName', function(t) {
* $('#somediv').html( t() );
* });
* Source: https://github.com/wycats/handlebars.js/issues/82
@illusionfield
illusionfield / str_replace.js
Created April 11, 2016 15:48 — forked from frentsel/str_replace.js
js analog PHP str_replace()
String.prototype.strReplace = function(find, replace) {
if(typeof find === 'string')
return this.split(find).join(replace);
var str = this;
for(var i in find)
str = str.split(find[i]).join(replace[i]);
return str;
// PhantomJS Cheatsheet
$ brew update && brew install phantomjs // install PhantomJS with brew
phantom.exit();
var page = require('webpage').create();
page.open('http://example.com', function() {});
page.evaluate(function() { return document.title; });
@illusionfield
illusionfield / gist:936ac94cdba5cf943aa0d34c91244fa0
Created May 31, 2016 19:51 — forked from JFK/gist:4591707
Ngnix + Nginx-GridFS-Replicaset(mongodb) + nginx-image-filter +nginx-proxy-cache Sample Configuration
user www-data;
#worker_processes 4;
#worker_priority 0;
#worker_cpu_affinity 0001 0010 0100 1000;
#worker_rlimit_nofile 163840;
#worker_processes 8;
#worker_priority 0;
#worker_cpu_affinity 00000001 00000010 00000100 00001000 00010000 00100000 01000000 10000000;