Skip to content

Instantly share code, notes, and snippets.

Matthew Conlen mathisonian

Block or report user

Report or block mathisonian

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mathisonian
mathisonian / browser-export.js
Created Nov 9, 2014
exporting client side code
View browser-export.js
// export as a Node module, an AMD module or a global browser variable
if (typeof module !== 'undefined') {
module.exports = myModule;
} else if (typeof define === 'function' && define.amd) {
define(function() {
return myModule;
});
View airlines.xml
<?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns
http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
<key id="x" for="node" attr.name="x" attr.type="double"/>
<key id="tooltip" for="node" attr.name="tooltip" attr.type="string"/>
<key id="y" for="node" attr.name="y" attr.type="double"/>
View particles.js
var THREE = require('three.js');
var _ = require('lodash');
var ParticleTest = function(selector, data, images, opts) {
var width = $(selector).width();
var height = width * 0.7;
@mathisonian
mathisonian / threejs-example.js
Last active Aug 29, 2015
threejs-lightning-example
View threejs-example.js
// modified from http://oos.moxiecode.com/js_webgl/dna/
var THREE = require('three.js');
var ThreeTest = function(selector, data, images, opts) {
var container;
var camera, scene, renderer, composer;
View index.html
<!DOCTYPE html>
<head>
<meta charset="utf-8">
</head>
<body>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script>
var svg = d3.select("body").append("svg")
.attr("width", 960)
.attr("height", 500);
@mathisonian
mathisonian / matrix.js
Last active Aug 29, 2015
lightning-import-test
View matrix.js
var d3 = require('d3');
var inherits = require('inherits');
var margin = {
top: 20,
right: 20,
bottom: 20,
left: 45
};
View lightning-ipython.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mathisonian
mathisonian / .functions
Last active Aug 29, 2015
encryption / decryption command line helpers
View .functions
encrypt() {
openssl des3 -in $1 -out $1.encrypted
}
decrypt() {
if [[ "$1" == *.encrypted ]]
then
openssl des3 -d -in $1 -out $(basename $1 .encrypted)
View gist:77fc31346bb9c0b97c69
### Keybase proof
I hereby claim:
* I am mathisonian on github.
* I am mathisonian (https://keybase.io/mathisonian) on keybase.
* I have a public key whose fingerprint is 80C1 97B6 BB09 F9D3 D2D5 11B8 4AEB CDE4 E46B 0304
To claim this, I am signing this object:
@mathisonian
mathisonian / model.js
Created Sep 17, 2014
mimicking an array data type with sequelize.js
View model.js
var MyModel = sequelize.define('MyModel', {
myArrayField: {
type: DataTypes.STRING,
get: function() {
return JSON.parse(this.getDataValue('myArrayField'));
},
set: function(val) {
return this.setDataValue('myArrayField', JSON.stringify(val));
}
}
You can’t perform that action at this time.