Skip to content

Instantly share code, notes, and snippets.

View Marak's full-sized avatar

Marak

View GitHub Profile
@Marak
Marak / anonymize-emails.py
Last active August 29, 2015 14:09 — forked from Siddhartha90/anonymize-emails.py
A python script which anonymizes email addresses in all files in current directory and sub-directories.
# A python script which anonymizes email addresses in all files in current directory and sub-directories.
# e.g. A file with the following contents:
# siddhartha@gmail.com
# Sid Phn#- 6385833322
# gupta49@illinois.edu
# weee@as.cd
# sid@yahoo.co.in
# Would change to:
@Marak
Marak / anonymize-emails.py
Last active August 29, 2015 14:09 — forked from Siddhartha90/anonymize-emails.py
A python script which anonymizes email addresses in all files in current directory and sub-directories.
# A python script which anonymizes email addresses in all files in current directory and sub-directories.
# e.g. A file with the following contents:
# siddhartha@gmail.com
# Sid Phn#- 6385833322
# gupta49@illinois.edu
# weee@as.cd
# sid@yahoo.co.in
# Would change to:
@Marak
Marak / anonymize-emails.py
Last active August 29, 2015 14:09 — forked from Siddhartha90/anonymize-emails.py
A python script which anonymizes email addresses in all files in current directory and sub-directories.
# A python script which anonymizes email addresses in all files in current directory and sub-directories.
# e.g. A file with the following contents:
# siddhartha@gmail.com
# Sid Phn#- 6385833322
# gupta49@illinois.edu
# weee@as.cd
# sid@yahoo.co.in
# Would change to:
@Marak
Marak / anonymize-emails.py
Last active August 29, 2015 14:09 — forked from Siddhartha90/anonymize-emails.py
A python script which anonymizes email addresses in all files in current directory and sub-directories.
# A python script which anonymizes email addresses in all files in current directory and sub-directories.
# e.g. A file with the following contents:
# siddhartha@gmail.com
# Sid Phn#- 6385833322
# gupta49@illinois.edu
# weee@as.cd
# sid@yahoo.co.in
# Would change to:
@Marak
Marak / anonymize-emails.py
Last active August 29, 2015 14:09 — forked from Siddhartha90/anonymize-emails.py
A python script which anonymizes email addresses in all files in current directory and sub-directories.
# A python script which anonymizes email addresses in all files in current directory and sub-directories.
# e.g. A file with the following contents:
# siddhartha@gmail.com
# Sid Phn#- 6385833322
# gupta49@illinois.edu
# weee@as.cd
# sid@yahoo.co.in
# Would change to:
@Marak
Marak / frakturHook.js
Last active August 29, 2015 14:09
hook.io hook for testing substack's fraktur
module['exports'] = function (hook) {
var fraktur = require('fraktur');
// assumes text has been posted as form data or is part of query string
// you could just as easily parse hook.req for incoming data instead
hook.res.end(fraktur(hook.params.text));
};
module['exports'].schema = {
"text": {
"type": "string",
@Marak
Marak / faker.js
Last active August 29, 2015 14:20
hook.io microservice wrapper for faker
module['exports'] = function faker (hook) {
var faker = require('faker');
var params = hook.params;
var parts = params.property.split('.');
faker.locale = hook.params.locale;
var result = faker[parts[0]][parts[1]]();
hook.res.end(JSON.stringify(result, true, 2));
@Marak
Marak / staticHook.js
Created May 19, 2015 19:31
hook.io microservice for serving static files from remote sources
module['exports'] = function staticHook (hook) {
hook.debug("Debug messages are sent to the debug console");
hook.debug(hook.params);
hook.debug(hook.req.path);
hook.debug(hook.req.method);
@Marak
Marak / view.js
Last active August 29, 2015 14:21
hook.io microservice for using the view module
module['exports'] = function view (hook) {
var view = require('view');
var marak = 'https://raw.githubusercontent.com/Marak/marak.com/master/view';
var url = hook.req.headers['x-forwarded-url'];
view.create( { remote: marak } , function (err, v) {
if (err) {
return hook.res.end(err.message);
}
v.remote(url, function (err, result) {
if (err) {
@Marak
Marak / colorsHook.js
Last active August 29, 2015 14:23
hook.io microservice for adding colors to text
var _colors = ["random", "red", "green", "blue", "yellow", "cyan", "rainbow", "zalgo"];
module['exports'] = function colorsHook (hook) {
var colors = require('colors'),
color = hook.params.color;
var text = hook.params.text || "";
// if random color is selected, return a random color