Skip to content

Instantly share code, notes, and snippets.

View nclzz's full-sized avatar

Nicola Lazzaroni nclzz

View GitHub Profile
@nclzz
nclzz / SketchSystems.spec
Created February 18, 2019 10:33
Autoquote
Autoquote
Is eligible -> Eligible
Not eligible
Eligible
@nclzz
nclzz / SketchSystems.spec
Last active August 6, 2018 14:43
Reservation
Reservation
Initial State*
Pay with Credit Card -> Is Form Valid?
Is Form Valid?
Yes -> Stripe Checkout
No -> Wanderio Flex Modal
Wanderio Flex Modal
Add Flex -> Is Form Valid?
Remove Flex -> Is Form Valid?
@nclzz
nclzz / moz-api.rb
Created March 30, 2014 22:21
Moz API Url Metrics using Ruby
# MOZ API http://apiwiki.moz.com/categories/api-reference
require 'openssl'
require 'base64'
require 'cgi'
require 'open-uri'
# You can obtain you access id and secret key here: http://moz.com/products/api/keys
ACCESS_ID = ""
SECRET_KEY = ""
@nclzz
nclzz / ruby-miniserver
Created February 24, 2014 10:34
Ruby command line to serve current directory
ruby -run -e httpd . -p 5000
Somebody asked me how to become a Product Manager. Here's what I wrote them.
---------------------------------------------------------------------------
Hi Jon,
Those are a lot of questions. Let me try to simplify it.
I think a Product Manager is a person who is responsible for determining
what a product should be and how it should evolve. This is a design role
@nclzz
nclzz / mixpanel-delete-people.py
Last active November 16, 2020 03:03
Run this script to delete all People data in a Mixpanel project. Thanks to the Mixpanel support team for providing me this solution.
#! /usr/bin/env python
import hashlib
import urllib
import time
try:
import simplejson as json
except ImportError:
import json
from pprint import pprint
@nclzz
nclzz / nclzz.zsh-theme
Last active December 23, 2015 03:38
nclzz zsh-theme v0.0.1
# nclzz zsh-theme v0.0.1
ZSH_THEME_GIT_PROMPT_PREFIX="⥱ $FG[075]"
ZSH_THEME_GIT_PROMPT_SUFFIX=""
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%} ✕ "
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%} ✓ "
PROMPT='
$reset_color⎧ %2~ $(git_prompt_info)
$reset_color⎩ '
@nclzz
nclzz / leaflet_multiple_popup.js
Created September 2, 2013 16:45
This little hack permits to open more than one popup at time with leaflet.js
/*** Place this before Map initialization ***/
L.Map = L.Map.extend({
openPopup: function(popup) {
// this.closePopup(); // just comment this
this._popup = popup;
return this.addLayer(popup).fire('popupopen', {
popup: this._popup
});
}
@nclzz
nclzz / log_formatter.rb
Created August 30, 2013 17:26
Rails 3.2 beautiful log formatter
# Just make a new file in your ‘config/initializers’ directory called something like ‘log_formatting.rb’ and paste into it the following code.
# Restart your app, and voila: pretty logs again!
class ActiveSupport::BufferedLogger
def formatter=(formatter)
@log.formatter = formatter
end
end
class Formatter
@nclzz
nclzz / Python miniserver
Last active December 21, 2015 01:58
Running a miniserver with Python
python -m SimpleHTTPServer 8888 &.
python -m http.server