Skip to content

Instantly share code, notes, and snippets.

View noscripter's full-sized avatar
✌️
Peace and love.

NoScripter noscripter

✌️
Peace and love.
View GitHub Profile
@noscripter
noscripter / bash-cheatsheet.sh
Created April 18, 2017 04:03 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@noscripter
noscripter / ga-time-to-first-paint.js
Created October 8, 2016 03:50 — forked from acdha/ga-time-to-first-paint.js
Record time to first paint on Chrome/IE using Google Analytics user timing
(function ($) {
'use strict';
/* Based on https://github.com/wikimedia/mediawiki-extensions-NavigationTiming/ */
function recordTimeToFirstPaint() {
// Use Chrome's loadTimes or IE 9+'s msFirstPaint to record the time to render in milliseconds:
var firstPaintTime, timingSource;
if ('chrome' in window && $.isFunction(window.chrome.loadTimes)) {
@noscripter
noscripter / modsecurity_mac.md
Created February 5, 2016 04:01 — forked from amarnus/modsecurity_mac.md
How to enable and setup ModSecurity on a Mac?

Use brew to install the ModSecurity Apache module.

brew install homebrew/apache/mod_security

Ask Apache to load the module by editing the configuration file (at /etc/apache2/httpd.conf). Under the long list of LoadModule statements, add:

LoadModule security2_module /usr/local/Cellar/mod_security/2.7.7/libexec/mod_security2.so

While you are at it, load the mod_unique_id module as well. This is required by ModSecurity. Do so by uncommenting the line:

@noscripter
noscripter / background.js
Created January 10, 2016 16:19 — forked from danharper/background.js
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
@noscripter
noscripter / vimdiff_cheet.md
Created January 5, 2016 11:06 — forked from roothybrid7/vimdiff_cheet.md
vimdiff cheet sheets.

Vimdiff cheet sheets.

##Git mergetool.

$ git config --global merge.tool=vimdiff

##vimdiff key mappings.

@noscripter
noscripter / iterm2.md
Created December 12, 2015 15:02
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
Previous Tab + Left Arrow
Next Tab + Right Arrow
Go to Tab + Number
Go to Window + Option + Number
Go to Split Pane by Direction + Option + Arrow
Go to Split Pane by Order of Use + ] , + [
@noscripter
noscripter / node-and-npm-in-30-seconds.sh
Created December 9, 2015 07:00 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@noscripter
noscripter / better-nodejs-require-paths.md
Created December 6, 2015 02:23 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

var Article = require('../../../models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@noscripter
noscripter / 00-about-search-api-examples.md
Created November 7, 2015 16:08 — forked from jasonrudolph/00-about-search-api-examples.md
5 entertaining things you can find with the GitHub Search API
@noscripter
noscripter / rules.conf
Created October 20, 2015 16:08 — forked from janlay/README.md
Yet another config for Surge.app (build 245+)
# This config file was created for myself (@janlay). You may want to add or remove some rules to make efficient use of the Internet.
# This file depends on the main.conf which defines your own proxy.
# Your main.conf will look like this:
# ---- START ----
# #!PROXY-OVERRIDE:rules.conf
# [Proxy]
# Proxy = https,server.address,port,username,password
# ---- END ----
#