Skip to content

Instantly share code, notes, and snippets.

View ericzon's full-sized avatar
🏠
Working from home

Eric ericzon

🏠
Working from home
View GitHub Profile
@ericzon
ericzon / proxy_info.txt
Last active January 21, 2024 16:51
Example of Tiny proxy with Basic auth
brew install tinyproxy
tinyproxy -c /usr/local/etc/tinyproxy/tinyproxy.conf -d
Tests:
NO AUTH
curl -iv --noproxy "*" --location http://www.google.com
AUTH FAIL
@ericzon
ericzon / securize_blank_links.js
Created January 14, 2020 18:41
Securize dynamically target blank links
@ericzon
ericzon / tagged_template_literals.js
Created December 4, 2019 17:45
Tagged template literals
function generaTemplate (strings, ...keys) {
return function(data) {
let temp = strings.slice();
keys.forEach((key, i) => {
temp[i] = temp[i] + data[key];
});
return temp.join('');
}
}
@ericzon
ericzon / NewLibrary.raml
Created April 6, 2017 09:16
RAML pet shop test
#%RAML 1.0 Library
traits:
FilterableByPrice:
queryParameters:
priceLessThen?:
type: number
priceMoreThen?:
type: number
resourceTypes:
var express = require('express');
var app = express();
var q = require('q');
function retryingPromise(fn, cfg, times) {
var counter = 0;
var delay = 0;
var _times = times ? times : 2;
var _step = _step ? step : 1000;
var _cfg = cfg ? cfg : {};