Skip to content

Instantly share code, notes, and snippets.

View lucasa's full-sized avatar
🤟
Out sick

Lucas Alberto lucasa

🤟
Out sick
View GitHub Profile
@bergie
bergie / noflo.json
Last active August 18, 2018 22:13
Draggable demo
{
"caseSensitive": false,
"properties": {
"name": "Movable image",
"environment": {
"type": "noflo-browser",
"content": "<style>\n.area {\n width: 100%;\n height: 300px;\n user-select: none;\n}\n.draggable {\n -moz-user-select: none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n -khtml-user-drag: element;\n -webkit-user-drag: element;\n cursor: -webkit-grab;\n cursor: -moz-grab;\n cursor: grab;\n width: 40px;\n height: 40px;\n border-radius: 20px;\n background-color:hsl(220,20%,20%);\n box-shadow: \n 0 -1px 0px hsl(220,100%,100%),\n 0 1px 1px hsla(220,20%,0%,.2),\n 0 3px 8px hsla(220,20%,0%,.1);\n}\n.draggable:active {\n cursor: -webkit-grabbing;\n cursor: -moz-grabbing;\n cursor: grabbing;\n}\n</style>\n\n<div class=\"area\">\n <img class=\"draggable\" src=\"https://meemoo.org/hack-our-apps/shots/recursive.png\" draggable=\"true\">\n</div>"
},
"icon": ""
},

Interactive Machine Learning

Taught by Brad Knox at the MIT Media Lab in 2014. Course website. Lecture and visiting speaker notes.

@cirocosta
cirocosta / DraggableSvgComp.jsx
Created January 29, 2015 13:38
Draggable React SVG Element
'use strict';
/**
* DraggableSvgComp ...
*/
const findSvgRoot = (DOMNode) =>
DOMNode.parentElement.localName === 'svg' ?
DOMNode.parentElement :
findSvgRoot(DOMNode.parentElement);
@bjmc
bjmc / install_sentry.sh
Created June 26, 2014 01:32
Basic setup script for installing Sentry (http://getsentry.com) + Redis on new Ubuntu 14.04 Amazon EC2 instance
#! /bin/bash
export RUN_AS='ubuntu';
export INSTALL_DIR='/var/www/sentry';
HOSTNAME='http://mysentry.example.com'; # No trailing slash
DB_HOST='something.rds.amazonaws.com';
DB_PORT='5432';
DB_USER='sentry';
DB_NAME='sentry';
DB_PASSWORD='DB_PASSWORD';
@timo22345
timo22345 / flatten.js
Last active November 29, 2025 11:57
Flatten.js, general SVG flattener. Flattens transformations of SVG shapes and paths. All shapes and path commands are supported.
<!doctype html>
<html>
<title>Flatten.js, General SVG Flattener</title>
<head>
<script>
/*
Random path and shape generator, flattener test base: https://jsfiddle.net/fjm9423q/embedded/result/
Basic usage example: https://jsfiddle.net/nrjvmqur/embedded/result/
@5263
5263 / blender-nurbs-selfcontained.py
Last active March 20, 2023 12:07
NURBS export for Blender and import for FreeCAD
#!/usr/bin/env python
freecadfunctions="""#!/usr/env/bin python
#python 2
import FreeCAD,Part
def pointstopoles1D(points):
return zip(*[(FreeCAD.Vector(point[0:3]),point[3]) for point in points])
def pointstopoles(points,cu):
poles=[]
@mourner
mourner / TileLayer.Common.js
Created February 11, 2012 23:11
Leaflet shortcuts for common tile providers
// Lefalet shortcuts for common tile providers - is it worth adding such 1.5kb to Leaflet core?
L.TileLayer.Common = L.TileLayer.extend({
initialize: function (options) {
L.TileLayer.prototype.initialize.call(this, this.url, options);
}
});
(function () {