Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'

Keybase proof

I hereby claim:

  • I am mderazon on github.
  • I am mderazon (https://keybase.io/mderazon) on keybase.
  • I have a public key whose fingerprint is A80C EB00 A6B8 EC21 47A3 E5B9 75D2 C988 4BF7 DC31

To claim this, I am signing this object:

@mderazon
mderazon / .jscsrc
Last active August 29, 2015 14:06
sublime-text setup
{
"requireCurlyBraces": [
"if",
"else",
"for",
"while",
"do",
"try",
"catch"
],
@mderazon
mderazon / json_i18n.js
Last active March 28, 2024 09:59
JSON i18n
var traverse = require('traverse');
// filter json obj by language
var filter_language = function(language, obj) {
var result = traverse(obj).map(function(item) {
if (this.key === language) {
this.parent.update(item);
}
});
return result;
@mderazon
mderazon / export-to-csv.gs
Last active April 2, 2024 22:25
Google apps script to export to individual csv files all sheets in an open spreadsheet
/*
* script to export data in all sheets in the current spreadsheet as individual csv files
* files will be named according to the name of the sheet
* author: Michael Derazon
*/
function onOpen() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var csvMenuEntries = [{name: "export as csv files", functionName: "saveAsCSV"}];
ss.addMenu("csv", csvMenuEntries);
@mderazon
mderazon / mongo-dump-csv.sh
Last active November 3, 2022 16:18
Export all of Mongodb collections as csv without the need to specify fields
OIFS=$IFS;
IFS=",";
# fill in your details here
dbname=DBNAME
user=USERNAME
pass=PASSWORD
host=HOSTNAME:PORT
# first get all collections in the database
@mderazon
mderazon / index.ejs
Created October 30, 2013 11:01
i18n add __ to view
<html>
<head>
<title>node, express and i18n</title>
</head>
<body>
<h1><%= __('Hello i18n')%></h1>
</body>
</html>
@mderazon
mderazon / app.js
Created October 30, 2013 10:43
adding i18n in express app
var express = require('express');
var i18n = require('./i18n');
var app = express();
app.set('views', __dirname + '/views');
app.use(i18n);
app.get('/', function(req, res) {
console.log(res.__('Hello i18n'));
@mderazon
mderazon / i18n.js
Created October 30, 2013 09:48
i18n module
var i18n = require('i18n');
i18n.configure({
// setup some locales - other locales default to en silently
locales:['en', 'iw'],
// where to store json files - defaults to './locales' relative to modules directory
directory: __dirname + '/locales',
defaultLocale: 'en',
@mderazon
mderazon / index.ejs
Last active December 26, 2015 23:19
i18n simple view
<html>
<head>
<title>node, express and i18n</title>
</head>
<body>
<h1>Hello i18n</h1>
</body>
</html>