Skip to content

Instantly share code, notes, and snippets.

View masterots's full-sized avatar

Joshua Melvin masterots

  • Rapid7
  • Greater Boston Area, MA
View GitHub Profile
@masterots
masterots / json_organizer.js
Last active December 14, 2015 14:39
json organizer
var correct = [];
var currentDepth = -1;
var recurse = function( children )
{
var item;
currentDepth++;
while( (item = treeData.shift()) !== undefined )
{
if( item.depth == currentDepth )
@masterots
masterots / lock icon
Last active August 20, 2020 15:46
svg path for a lock icon (sourced from FontAwesome)
M7.715,4.929v3.857c0,0.179-0.063,0.331-0.188,0.456S7.25,9.429,7.071,9.429H0.644c-0.179,0-0.331-0.063-0.456-0.188S0,8.964,0,8.786V4.929c0-0.179,0.063-0.33,0.188-0.456c0.125-0.125,0.277-0.188,0.456-0.188h0.214V3c0-0.821,0.295-1.527,0.884-2.116C2.331,0.295,3.036,0,3.857,0s1.526,0.295,2.116,0.884C6.563,1.473,6.857,2.179,6.857,3v1.286h0.214c0.179,0,0.331,0.063,0.456,0.188C7.652,4.599,7.715,4.75,7.715,4.929z M2.144,4.286h3.428V3c0-0.473-0.167-0.877-0.502-1.212S4.33,1.286,3.857,1.286c-0.474,0-0.877,0.167-1.212,0.502S2.144,2.527,2.144,3V4.286z M4.715,6c0-0.236-0.084-0.438-0.251-0.606c-0.168-0.167-0.37-0.251-0.606-0.251S3.419,5.227,3.251,5.394C3.084,5.562,3,5.764,3,6c0,0.166,0.043,0.315,0.128,0.449c0.084,0.134,0.198,0.239,0.341,0.315L3.007,8.297C2.984,8.364,2.996,8.427,3.04,8.484c0.045,0.058,0.103,0.087,0.175,0.087H4.5c0.071,0,0.13-0.029,0.175-0.087C4.719,8.427,4.73,8.364,4.708,8.297L4.246,6.764c0.143-0.076,0.256-0.181,0.341-0.315S4.715,6.166,4.715,6z
@masterots
masterots / app_list
Last active December 21, 2015 05:39
list of apps to install
openemu
dolphin
scout
the unarchiver
openoffice
intellij
gas mask
bittorrent sync
visualjson
@masterots
masterots / gist:6799539
Last active December 24, 2015 12:39
twisted-tech setup script
#!/bin/sh
apt-get update
apt-get install curl -y
apt-get install vim -y
su vagrant -c '\curl -L https://get.rvm.io | bash -s stable --ruby=2.0.0'
wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh
@masterots
masterots / multiplesOf3and5.js
Last active August 29, 2015 14:20
project euler 1 : multiples of 3 and 5
var sum = 0;
for (var i = 0; i < 1000; i++) {
sum += i % 3 === 0 ? i : 0;
sum += i % 5 === 0 ? i : 0;
}
console.log(sum);
for (var i = 1; i < 100; i++) {
var output = i % 3 === 0 ? 'fizz' : '';
output += i % 5 === 0 ? 'buzz' : '';
console.log(output ? output : i);
}
@masterots
masterots / sumOfEvenFibonacciNumbers.js
Last active August 29, 2015 14:20
Project Euler - Even Fibonacci numbers
function *fibbonacciGenerator(max) {
if (!max) {
console.log("Please enter a maximum number for the fibbonacciGenerator");
return;
}
var previous = 0;
var next = 1;
var current = 1;
while (current < max) {
yield current;
@masterots
masterots / largestPrimeFactor.js
Created April 30, 2015 21:11
Project Euler - Largest prime factor
function isPrime(n) {
if (isNaN(n) || !isFinite(n) || n % 1 || n < 2) {
return false;
}
if (n % 2== 0) {
return (n == 2);
}
if (n % 3== 0) {
return (n == 3);
}
@masterots
masterots / largestPalindrome.js
Created April 30, 2015 22:00
Project Euler - largest palindrome
function largestPalindrome(lowNum, highNum) {
var max = 0;
for (var i = highNum; i >= lowNum; i--) {
for (var j = i; j >= lowNum; j--) {
var mul = j * i;
if (isPalindrome(mul) && mul > max) {
max = i * j;
}
}
}

Keybase proof

I hereby claim:

  • I am masterots on github.
  • I am masterots (https://keybase.io/masterots) on keybase.
  • I have a public key ASDKksouqkELMOinqkwFJrkHvsBh57JuvXtrs_hGFgD8Bgo

To claim this, I am signing this object: