Skip to content

Instantly share code, notes, and snippets.

Katie Miller phedinkus

Block or report user

Report or block phedinkus

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
View heatmap-patterns-plus-minus.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>heatmap patterns</title>
<script src="index.js"></script>
<link rel="stylesheet" type="text/css" href="index.css">
</head>
<body>
View DIST_IMPLIMENTATION.md
find_euclidean_distance <- function(stratum_data) {
  # seed_value comes from the wrapper function init
  set.seed(seed_value)
  stratum_mean <- moment(stratum_data, order=1, central=FALSE)
  sqrt(rowSums((stratum_data - stratum_mean)^2))
}
View redis_timeout.rb
App 10209 stdout: Redis::TimeoutError (Connection timed out):
App 10209 stdout: /Users/kt/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/redis-3.2.1/lib/redis/connection/ruby.rb:55:in `rescue in _read_from_socket'
App 10209 stdout: /Users/kt/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/redis-3.2.1/lib/redis/connection/ruby.rb:48:in `_read_from_socket'
App 10209 stdout: /Users/kt/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/redis-3.2.1/lib/redis/connection/ruby.rb:41:in `gets'
App 10209 stdout: /Users/kt/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/redis-3.2.1/l
App 10209 stdout: ib/redis/connection/ruby.rb:273:in `read'
App 10209 stdout: /Users/kt/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/redis-3.2.1/lib/redis/client.rb:248:in `block in read'
App 10209 stdout: /Users/kt/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/redis-3.2.1/lib/redis/client.rb:236:in `io'
App 10209 stdout: /Users/kt/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/redis-3.2.1/lib/r
View github_interview.md

Scenario 1

A product I love is BurdaStyle.

####Features To Add

  • Premium email newsletter subscription that comes with a few simple patterns and articles about techniques.

    This European based company publishes a magazine multiple times a year with very limited distribution in the US. non-European customers can subscribe to the US version of the magazine but it's expensive and orders take a long time to process.

@phedinkus
phedinkus / broad_ip_county_school_counts.csv
Last active Aug 29, 2015
2010 Inference Populations County School Counts
View broad_ip_county_school_counts.csv
id count
01095 14
01015 17
01073 90
01043 14
01049 13
01053 7
01077 14
01089 45
01081 19
View analysis.R
library(cluster)
library(moments)
# # # if(!require(data.table)){install.packages("data.table")}
library(data.table)
school_data_set <- read.csv("school_data_test.csv")
# str(school_data_set)
print("analysis.R loaded successfully")
# This returns the unscaled data_set with the cluster assignment and cluster distance
# ?? What other values will we need to return and display to the user?
View AngularObjectCache.js
angular.factory("Application", function($http){
// We found in benchmarking that $resource was slower than bare $http
this.get = function(){
return $http("url/to/application/data", {params: anythingNeeded});
}
});
angular.service("ApplicationCache", function($timeout, Application){
var cache = [],
cacheMap = {},
@phedinkus
phedinkus / ajaxModalForm.js
Last active Dec 18, 2015
Initialize a bootstrap modal with a form which submits with ajax. This is my first foray using JQuery's widget factory: http://learn.jquery.com/jquery-ui/widget-factory/how-to-use-the-widget-factory/
View ajaxModalForm.js
// Dependent on twitter bootstrap's modal plugin
// Per Bootstrap's api, link to trigger modal should have a data-toggle="modal" attribute
// Modal markup should have one form element
// Initializes with the link or button element which opens the modal
// $("#my-button-element").ajaxModalForm({success: someSuccessFunction, error: someErrorFunction});
$.widget("myNamespace.ajaxModalForm", {
_create: function(){
this.$form = this.element.find("form");
@phedinkus
phedinkus / gist:5223404
Created Mar 22, 2013
Basic auth for Sinatra
View gist:5223404
use Rack::Auth::Basic, "Restricted Area" do |username, password|
[username, password] == ['your username', 'your password']
end
View gist:5033704
client = Mysql2::Client.new(:host => "localhost", :username => "root")
results = client.query("SELECT Posts.ID FROM Posts WHERE Posts.ID != 10000")
results.first
You can’t perform that action at this time.