Skip to content

Instantly share code, notes, and snippets.

@Scribblerockerz
Scribblerockerz / xhr.js
Created September 13, 2013 08:09 — forked from mythz/xhr.js
//Adds $.xhr and jQuery-like $.ajax methods to the prescribed namespace.
//Inspired from David Flanagans excellent cross-platform utils http://www.davidflanagan.com/javascript5/display.php?n=20-1&f=20/01.js
//Includes underscore.js _.each and _.extend methods
//modified to behave like jQuery's $.ajax(), not complete.
(function($) {
var win=window, xhrs = [
function () { return new XMLHttpRequest(); },
function () { return new ActiveXObject("Microsoft.XMLHTTP"); },
function () { return new ActiveXObject("MSXML2.XMLHTTP.3.0"); },
function () { return new ActiveXObject("MSXML2.XMLHTTP"); }
@Scribblerockerz
Scribblerockerz / ajax.js
Last active December 24, 2015 22:49
Minimal ajax function. No fallback for older browsers (lt IE7).
;(function(exports){
exports.ajax = function(opt){
var req = new XMLHttpRequest(),
res,
opt = opt || {};
//defaults
opt.success = opt.success || function(){};
opt.params = opt.params || {};
opt.type = opt.type || 'GET';
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ bla/blub/index.php?q=$1 [L]
@Scribblerockerz
Scribblerockerz / whitelist.txt
Last active August 29, 2015 13:58
A whitelist of pages without annoying advertisement
! Annoyifyed free advertising
@@||smashingmagazine.com/$document
! EOF
@Scribblerockerz
Scribblerockerz / .zshrc
Created September 26, 2014 07:33
Change terminals php version to the current mamp pro's one
php_bin=`grep "php5_module" ~/Library/Application\ Support/appsolute/MAMP\ PRO/httpd.conf | egrep -o "/.*/php\d+(.\d+)*"`
export PATH="$php_bin/bin:$PATH"
@Scribblerockerz
Scribblerockerz / Gulpfile.js
Last active September 30, 2015 20:49
Workflow with Sass compilation, JavaScript concatenation and image optimisation — so many *ation's
/**
* Terminal shortcut:
* `npm install --save-dev gulp gulp-imagemin gulp-sass gulp-sourcemaps gulp-concat gulp-uglify gulp-rename`
*/
var gulp = require('gulp'),
sass = require('gulp-sass'),
imagemin = require('gulp-imagemin'),
sourcemaps = require('gulp-sourcemaps'),
concat = require('gulp-concat'),
@Scribblerockerz
Scribblerockerz / .zshrc
Created September 30, 2015 09:11
An alias to execute all phpStorm's scratch files
alias scratch='for f in ~/Library/Preferences/WebIde90/scratches/*; do echo "\e[93m--------- EXECUTE: `basename $f` ---------\n\n\e[37m"; php -d display_errors $f; echo "\n\n"; done;'
@Scribblerockerz
Scribblerockerz / mailcatcher-install.md
Created December 18, 2015 10:11 — forked from pitpit/mailcatcher-install.md
Install Mailcatcher on OSX

Keybase proof

I hereby claim:

  • I am scribblerockerz on github.
  • I am scribblerockerz (https://keybase.io/scribblerockerz) on keybase.
  • I have a public key ASBG8wxAJKB-OdaflmBkehiyG2rIROMaimBh3q87P3OVRAo

To claim this, I am signing this object:

@Scribblerockerz
Scribblerockerz / brew-instructions.sh
Created October 5, 2021 13:56 — forked from petemcw/brew-instructions.sh
Setup dnsmasq on Mac OS X
# Install `dnsmasq` and configure for *.dev domains
$ brew install dnsmasq
$ vim /usr/local/etc/dnsmasq.conf
# Reload configuration and clear cache
$ sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
$ sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
$ dscacheutil -flushcache