Skip to content

Instantly share code, notes, and snippets.

View espinielli's full-sized avatar

Enrico Spinielli espinielli

View GitHub Profile
@schacon
schacon / gist:1
Created July 15, 2008 18:17
the meaning of gist
This is gist.
There are many like it, but this one is mine.
It is my life.
I must master it as I must master my life.
Without me gist is useless.
Without gist, I am useless.
@cowboy
cowboy / ba-detach.js
Created April 23, 2011 16:43
JavaScript detach: detach a node from the DOM, optionally reattaching it when done.
/*!
* JavaScript detach - v0.2 - 5/18/2011
* http://benalman.com/
*
* Copyright (c) 2011 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
function detach(node, async, fn) {
@simme
simme / Install_tmux
Created October 19, 2011 07:55
Install and configure tmux on Mac OS X
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using Terminal.app (iTerm has mouse support)
Install http://www.culater.net/software/SIMBL/SIMBL.php
Then install https://bitheap.org/mouseterm/
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/
@mbostock
mbostock / quantize.js
Last active February 9, 2016 01:20
Simplifying and cleaning Shapefiles.
us.coordinates = us.coordinates.map(function(polygon) {
return polygon.map(function(lineString) {
return lineString.map(function(point) {
return point.map(function(coordinate) {
return d3.round(coordinate, 2);
});
});
})
});
@jordan-brough
jordan-brough / instructions.markdown
Created November 3, 2012 13:50
Splunk-friendly timestamp plugin snippet for Sublime Text 2
  1. Choose: Tools > New Plugin

  2. Paste in the contents of "timestamp.py" below

  3. Save as timestamp.py in ~/Library/Application Support/Sublime Text 2/Packages/User/ (should be the default directory that pops up when you save)

  4. Choose: Sublime Text 2 > Preferences > Key Bindings - User

  5. Add:

    { "keys": ["super+ctrl+t"], "command": "timestamp" }

To make command+ctrl+t perform the insertion.
Make sure to add a comma after the previous keymap entry, if present.

@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 19, 2024 11:00
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@victorreyesh
victorreyesh / Aircrack Commands
Created September 12, 2013 03:36
Cracking WPA2 / WEP Wifi / Aircrack 10 seconds guide. For Mac OSX
//Install Macports.
//Install aircrack-ng:
sudo port install aircrack-ng
//Install the latest Xcode, with the Command Line Tools.
//Create the following symlink:
sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport
//Figure out which channel you need to sniff:
sudo airport -s
sudo airport en1 sniff [CHANNEL]
@dwtkns
dwtkns / README.md
Last active May 28, 2019 06:59
Sun and Earth

Experiments faking 3d rotation of a globe and sun in SVG. Illusion is helped by dynamic gradients, two nested orthographic projections, scaling the sun circle's radius based on distance from the 'camera', and toggling a clipping mask that makes the sun appear to move "behind" the earth.

Based on Mike Bostock's Solar Terminator and this past experiment.

This example stems from drafts of maps for Norway the Slow Way. Also see Mike's Pencil Sketch example.

@capesean
capesean / README.md
Last active April 21, 2020 01:18
TopoJSON Property Editor

TopoJSON Property Editor

  1. Supply the tool with some topoJSON data (via url or direct input), and it will draw the map.
  2. Click one of the shapes and you can view and edit the properties of the topoJSON object.
  3. Click the Output tab and you can copy the full, modified topoJSON.

View on http://bl.ocks.org/

@hrbrmstr
hrbrmstr / phantomjs.R
Created December 29, 2014 15:29
Scraping gnarly sites with phantomjs & rvest
library(rvest)
# example of using phantomjs for scraping sites that use a twisty maze
# of javascript to render HTML tables or other tags
# grab phantomjs binaries from here: http://phantomjs.org/
# and stick it somehere PATH will find it
# this example scrapes the user table from: