Skip to content

Instantly share code, notes, and snippets.

View phedinkus's full-sized avatar

Katie Miller phedinkus

View GitHub Profile
<!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>
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))
}
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

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 August 29, 2015 14:23
2010 Inference Populations County School Counts
id count
01095 14
01015 17
01073 90
01043 14
01049 13
01053 7
01077 14
01089 45
01081 19
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?
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 December 18, 2015 11:29
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/
// 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 March 22, 2013 17:59
Basic auth for Sinatra
use Rack::Auth::Basic, "Restricted Area" do |username, password|
[username, password] == ['your username', 'your password']
end
@phedinkus
phedinkus / gist:5033704
Created February 25, 2013 21:57
mysql command
client = Mysql2::Client.new(:host => "localhost", :username => "root")
results = client.query("SELECT Posts.ID FROM Posts WHERE Posts.ID != 10000")
results.first