Skip to content

Instantly share code, notes, and snippets.

@slojo404
slojo404 / linkedin-api-invite
Created May 29, 2012 01:22 — forked from hjr3/linkedin-api-invite
Simple example of using the LinkedIn JavaScript SDK to send an invite
<!DOCTYPE html>
<html>
<head>
<script>
function invite() {
var url = '/people/~/mailbox',
body = {
recipients: {
values: [{
person: {
@slojo404
slojo404 / learning_gabor_filters.py
Created May 26, 2012 03:25 — forked from amueller/learning_gabor_filters.py
Learning Gabor filters with scikit-learn and ICA or k-means
import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import fetch_mldata
from sklearn.decomposition import FastICA, PCA
from sklearn.cluster import KMeans
# fetch natural image patches
image_patches = fetch_mldata("natural scenes data")
X = image_patches.data
<!DOCTYPE html>
<html>
<head>
<title>Projection Demo</title>
<script type='text/javascript' src='http://mbostock.github.com/d3/d3.js'></script>
<script type='text/javascript' src='http://mbostock.github.com/d3/d3.geo.js'></script>
<style type='text/css'>
body {
margin:5px auto;
}
@slojo404
slojo404 / README.md
Created April 19, 2012 20:14 — forked from syntagmatic/README.md
Canvas Parallel Coordinates - Shuffled Rendering

An example of an SVG interaction layer over a canvas rendering layer. Data from the USDA Nutrition Database.

This example has a few design differences from most parallel coordinates:

  • requestAnimationFrame for gradual rendering
  • shuffled rendering order (Fisher-Yates)
  • bezier curves with canvas
  • autoscaling opacity
  • tick toggles
  • dark/light themes
@slojo404
slojo404 / index.html
Created April 19, 2012 01:10 — forked from stepheneb/index.html
D3 Example: zoom, pan, and axis rescale
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>One Graph</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.v2.js"></script>
<script type="text/javascript" src="simple-graph.js"></script>
<style type="text/css">
body { font: 13px sans-serif; }
rect { fill: #fff; }
@slojo404
slojo404 / index.html
Created April 18, 2012 20:22 — forked from bunkat/index.html
Swimlane Chart using d3.js
<html>
<head>
<title>Swimlane using d3.js</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.v2.js"></script>
<script type="text/javascript" src="randomData.js"></script>
<style>
.chart {
shape-rendering: crispEdges;
}
@slojo404
slojo404 / index.html
Created April 18, 2012 20:20 — forked from bunkat/index.html
Timeline using d3.js
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Chronological Diagram of Asia</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.v2.js"></script>
<style type="text/css">
.chart {
shape-rendering: crispEdges;
}
@slojo404
slojo404 / README.md
Created April 11, 2012 19:12 — forked from mbostock/.block
Line Transition

D3’s default path interpolation is the same as its string interpolation: it finds numbers embedded in strings, and interpolates those numbers. So, the default behavior when interpolating two paths is like this:

M x0, y0 L x1, y1 L x2, y2 L x3, y3 
   ↓   ↓    ↓   ↓    ↓   ↓    ↓   ↓
M x0, y1 L x1, y2 L x2, y3 L x3, y4 

For example, the first point ⟨x0,y0⟩ is interpolated to ⟨x0,y1⟩. Since x0 is the same, all you see are the y-values changing (see example)—you don't see the path slide to the left as intended.

What you want to happen here is something like this:

@slojo404
slojo404 / logstash RPM spec
Created March 28, 2012 18:11 — forked from paul-at/logstash RPM spec
logstash monolithic init script and spec file for CentOS / RedHat
Name: logstash
Version: 1.1.0
Release: 1%{?dist}
Summary: logstash is a tool for managing events and logs
Group: System/Logging
License: ASL 2.0
URL: http://logstash.net/
Source0: http://semicomplete.com/files/logstash/logstash-%{version}-monolithic.jar
Source1: logstash