Skip to content

Instantly share code, notes, and snippets.

@zefer
zefer / Install_nginx_from_src_with_module.sh
Created February 16, 2011 12:26
Compile nginx from source, include the Headers More module - Ubuntu
sudo su -
# stuff we need to build from source
apt-get install libpcre3-dev build-essential libssl-dev
# get the nginx source
cd /opt/
wget http://nginx.org/download/nginx-0.8.54.tar.gz
tar -zxvf nginx*
# we'll put the source for nginx modules in here
@petrockblog
petrockblog / gist:3051595
Created July 5, 2012 05:49
Matlab plugin for Sublime Text 2
import sublime
import sublime_plugin
import os
class OpenmatlabfunctionCommand(sublime_plugin.TextCommand):
def run(self, edit):
for sels in self.view.sel():
didFind = False
@mbostock
mbostock / .block
Last active June 1, 2021 21:40 — forked from mbostock/.block
Multi-Series Line Chart
license: gpl-3.0
redirect: https://beta.observablehq.com/@mbostock/d3-multi-line-chart
@jo
jo / README.md
Created November 13, 2012 21:46
Selectable elements

Provide selection capabilities for DOM elements, geared to <select multiple>.

  • click: select element
  • ctrl + click: add element to current selection
  • click + move: select elements while dragging
  • ctrl + a: select all elements within focused list
  • ctrl + shift + a: deselect all elements within focused list
  • ctrl + click + move: toggle selection while dragging
  • shift + click: select range from nearest last selected element to clicked element
  • shift + ctrl + click: add range to current selection
@mbostock
mbostock / .block
Last active March 6, 2024 04:06
Gradient Along Stroke
license: gpl-3.0
@tmcw
tmcw / index.html
Created January 3, 2013 17:05
d3.keybinding
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font:12px/20px 'Helvetica';
}
textarea, input {
width:100%;
height:20px;
margin:0;
@conorbranagan
conorbranagan / gist:4513828
Last active April 13, 2024 20:06
Linux System Metrics

Linux System Metrics

CPU

  • system.cpu.idle: % Idle CPU
  • system.cpu.system: % System CPU
  • system.cpu.user: % User CPU

Disk

@lgersman
lgersman / README.md
Last active October 19, 2022 12:15
improved version of my d3.js selection frame example (https://gist.github.com/lgersman/5310854) supporting draggable/selectable nodes
  • Click into the drawing area to start the selection frame
  • move the mouse to resize the selection frame
  • Release the mouse button to resize the selection frame

new features :

  • circles are draggable
  • circles can be selected (multiple selections possible by pressing CTRL while clicking a circle)
  • the selection frame selects all circles within the frame (by pressing CTRL the selected circles will be appended to current selection)
  • multiple selected circles will be dragged simultaneous
@aras-p
aras-p / preprocessor_fun.h
Last active April 28, 2024 15:25
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@mbostock
mbostock / .block
Last active April 11, 2024 18:53
Brush Snapping
license: gpl-3.0
redirect: https://observablehq.com/@d3/brush-snapping-transitions