Skip to content

Instantly share code, notes, and snippets.

View mattallty's full-sized avatar
👾
Working on new stuff

Matt mattallty

👾
Working on new stuff
View GitHub Profile
@mattallty
mattallty / my-test.js
Created January 10, 2018 12:40
My test
console.log("Hello world");
var cntPos = 0;
var vectPosX = new Array();
var vectPosY = new Array();
var vectPosZ = new Array();
var cntNeg = 0;
var vectNegX = new Array();
var vectNegY = new Array();
var vectNegZ = new Array();
var vectBufIx = 0, minX = 0.0, maxX = 0.0, minY = 0.0, maxY = 0.0, minZ = 0.0, maxZ = 0.0;
@mattallty
mattallty / immutable.js
Created July 11, 2017 08:03
Simple Immutable structure in ES6 (testing es6 proxies)
const Immutable = function (source) {
const validator = {
get(target, key) {
if (typeof target[key] === 'object' && target[key] !== null) {
return new Proxy(target[key], validator)
}
return target[key];
},
set: function immutableInterceptor(target, key) {
throw new Error(`Cannot mutate "${key}" on Immutable object`);
@mattallty
mattallty / .profile
Created February 28, 2017 22:33 — forked from sindresorhus/.profile
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
@mattallty
mattallty / hough.js
Last active August 29, 2015 14:27 — forked from pguyot/hough.js
Hough transform
var fs = require("fs"),
Canvas = require("canvas"),
Image = Canvas.Image;
var LEAST_REQUIRED_DISTANCE = 20, // LEAST required distance between 2 points , lets say smallest ellipse minor
LEAST_REQUIRED_ELLIPSES = 80, // number of found ellipse
arr_accum = [],
arr_edges = [],
edges_canvas,
@mattallty
mattallty / config.json
Last active August 29, 2015 14:12 — forked from anonymous/config.json
Limedocs Bootstrap Theme
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Updated: 2010/12/05
// License: MIT
//
// Copyright (c) 2010-2013 Diego Perini (http://www.iport.it)
//
// Permission is hereby granted, free of charge, to any person
function modify(modifiers) {
return through2.obj(function(file, encoding, done) {
var stream = this;
function applyModifiers(content) {
(typeof modifiers === 'function' ? [modifiers] : modifiers).forEach(function(modifier) {
content = modifier(content, file);
});
@mattallty
mattallty / es.sh
Last active August 29, 2015 13:57
cd ~
sudo apt-get update
sudo add-apt-repository ppa:webupd8team/java -y
sudo apt-get update
sudo apt-get install oracle-java7-installer -y
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.1.deb
sudo dpkg -i elasticsearch-1.0.1.deb
sudo update-rc.d elasticsearch defaults 95 10
sudo service elasticsearch start
#curl http://localhost:9200