Skip to content

Instantly share code, notes, and snippets.

@Marak
Marak / anonymize-emails.py
Last active Aug 29, 2015 — forked from Siddhartha90/anonymize-emails.py
A python script which anonymizes email addresses in all files in current directory and sub-directories.
View anonymize-emails.py
# 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 Aug 29, 2015 — forked from Siddhartha90/anonymize-emails.py
A python script which anonymizes email addresses in all files in current directory and sub-directories.
View anonymize-emails.py
# 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 Aug 29, 2015 — forked from Siddhartha90/anonymize-emails.py
A python script which anonymizes email addresses in all files in current directory and sub-directories.
View anonymize-emails.py
# 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 Aug 29, 2015 — forked from Siddhartha90/anonymize-emails.py
A python script which anonymizes email addresses in all files in current directory and sub-directories.
View anonymize-emails.py
# 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 Aug 29, 2015 — forked from Siddhartha90/anonymize-emails.py
A python script which anonymizes email addresses in all files in current directory and sub-directories.
View anonymize-emails.py
# 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 Aug 29, 2015
hook.io hook for testing substack's fraktur
View frakturHook.js
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 Aug 29, 2015
hook.io microservice wrapper for faker
View faker.js
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
hook.io microservice for serving static files from remote sources
View staticHook.js
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 Aug 29, 2015
hook.io microservice for using the view module
View view.js
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 Aug 29, 2015
hook.io microservice for adding colors to text
View colorsHook.js
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