Skip to content

Instantly share code, notes, and snippets.

Avatar

Gregory Hilkert EpiphanyMachine

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am EpiphanyMachine on github.
  • I am ghilkert (https://keybase.io/ghilkert) on keybase.
  • I have a public key whose fingerprint is 73FB 620A D527 AB3A AEE5 C58E 2F61 C35A 4201 2521

To claim this, I am signing this object:

@EpiphanyMachine
EpiphanyMachine / pia-iptm
Created Apr 26, 2015
PIA Iptables Manager v0.5
View pia-iptm
#!/bin/bash
# PIA Iptables Manager
# Version 0.5
# Modified by: EpiphanyMachine@gmail.com
# Originally Created by ShadowSpectre <shadowspectre@tormail.org>
# https://www.privateinternetaccess.com/forum/discussion/1151/pia-iptables-manager-new
clear
echo ".: PIA Iptables Manager v0.4 :."
View numberToRoman.js
function toRoman(number) {
'use strict';
var v = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1], // set values
r = [ 'M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I'], // set numerals
n = Math.round(number), // clean number, round to nearest integer
limit = 3999, // set max limit to check integers against
s = '', // create empty string for numerals
val; // create temp val variable
// check if number is greater than the limit
@EpiphanyMachine
EpiphanyMachine / JS Solution
Created Dec 4, 2013
Basic Dijkstra's Algorithm (assume same edge weights) https://www.youtube.com/watch?v=gdmfOwyQlcI
View JS Solution
// thanks to:
// Adam - https://github.com/acreeger
// Juan - https://github.com/nilnullzip
// Note that I decided the search order heuristic should be based solely on the person being visited
// and the goal person. The position within the graph should not be considered, so the graph edges
// are not annotated. Rather a heuristic function is used that takes as input only two people. I believe
// this makes more sense if the heuristic is based on things like number of friends or similarity in
// things like: school, city, job, etc.
View Anagrams Solution
var dict = require('dictionary');
var solveJumble = function (string) {
'use strict';
var originalBag = string.split('');
var anagrams = [];
var findAnagrams = function (bag, word) {
var tempBag, tempWord;
for (var i = 0; i < bag.length; i++) {
tempBag = bag.slice();
@EpiphanyMachine
EpiphanyMachine / Balanced Parentheses Prompt
Last active Dec 26, 2015
Algorithms Meetup 21 Oct 13
View Balanced Parentheses Prompt
#
# write a function that takes a string of text and returns true if
# the parentheses, brackets, and braces are balanced and false otherwise.
#
# Example:
# balanceParens('[](){}'); // true
# balanceParens('[({})]'); // true
# balanceParens('[(]{)}'); // false
#
# Step 3:
View robotPathsBasic
var paths = function (n) {
var time = new Date();
var board = [];
for (var i = 0; i < n; i++) {
board.push([]);
for (var j = 0; j < n; j++) {
board[i].push(0);
}
}
board[0][0] = 1;
View feature create
features = [] # make new empty list
counter = 0
for row in train:
# for row in range(len(train)-1): # for every row in the data
# print row
# data we need to create features
# items needed to test questions
# PANDAS USAGE
question_tokens = nltk.word_tokenize(row[0]) # all tokens (words, punc, etc)
question_tags = nltk.pos_tag(question_tokens) # all tokens and parts of speech in lists