Skip to content

Instantly share code, notes, and snippets.

@josephwegner
josephwegner / twittercard.html
Created January 4, 2015 15:53
Twitter Card
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/assets/style/style.css" />
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Source+Code+Pro:400,600|Open+Sans:300,400italic,400,600,600italic">
<script type="text/javascript" src="/assets/js/angular.min.js"></script>
<script type="text/javascript" src="/assets/js/angular-cookies.min.js"></script>
<script type="text/javascript" src="/assets/js/main-min.js"></script>
<title>Title of my twitter card</title>
@josephwegner
josephwegner / stack.md
Created November 11, 2014 20:20
GTM, GA, Angular, ui-router bug

I am building a SPA using Angular.js. We use Google Tag Manager to load in most of our analytics/marketing scripts, which includes Google Analytics. I am also using ui-router to manage states/views.

I would like to send pageview events off to Google Analytics whenever a user browses to a different state in my app. Part of the complexity in doing this with GTM is that GTM creates a named tracker. That means that all GA events need be prepended with the tracker name. That would usually look like this:

 ga('trackerName.send', 'pageview', {page: '/a/path/', title: 'A Title'});

GTM uses a randomly generated tracker name, so the tracker name needs to be grabbed at runtime. That can be done fairly s

@josephwegner
josephwegner / bite.coffee
Created October 15, 2014 18:11
Loading Google Maps Asynchronously for angular-ui-maps
'use strict'
reqModules = [
'ui.router'
'ui.map'
'bitesApp.bites'
'google-maps-sdk'
]
@josephwegner
josephwegner / clef.md
Last active August 29, 2015 14:04
Clef vs Auth

The comparison between Authy and Clef is a difficult one to make on paper. While I haven't dug into Authy's security architecture as deep as I have with Clef, I'd imagine that technically the two solutions are very similar. Authy doesn't go into any detail about their security architecture on their website - which is one notable difference between them and Clef - but if they are following industry standards then both apps should be similarly secure.

With the technology similar, the big differentiator for me is market adoption (or likelihood of adoption). Passwords are used universally - if you've ever touched the internet, you almost certainly have a password. Replacing passwords, which both Clef and Authy intend to do, is a large task. Unfortunately it's also a winner-takes-all game. Most people don't really care that their passwords are insecure. Authy & Clef alone make it pretty easy to make the switch, but that only works if every site with two-factor authentication uses the same provider. Normal people

@josephwegner
josephwegner / questions.md
Last active August 29, 2015 14:02
Pullup Interview

How did Pullup get started? Who all was involved, and how did the idea come about?

<answer here>

Pullup is one of the fastest growing projects on Github. How did you get so much traction so quickly?

<answer here>

As far as technology goes, how is Pullup built? Has much changed in the architecture between now and the initial launch?

@josephwegner
josephwegner / posts.md
Created May 30, 2014 15:08
Drafted Blog Posts

Summertime Email Marketing Strategy

Updated At: 2014-05-20 16:41:53
Created At: 2014-05-20 16:55:09

Flop�s Fave Reward: 7-Eleven

Updated At: 2013-12-28 00:26:54
Created At: 2014-01-28 16:31:02

@josephwegner
josephwegner / details.md
Created May 26, 2014 15:10
Men's Bible Study Description

Men's bible study outline

Who to invite to pilot:

  • Justin
  • Jared
  • Kevin Lipp
  • Kevin Loughrin
  • Robby
  • Eric
  • Dave
@josephwegner
josephwegner / documentation.md
Last active September 6, 2015 03:53
Router Hacked Documentation

My router has been hacked. Here's what I know:

I'm unaware of how my router became infected, but the password has definitely been changed. I admittedly had not done any firmware updates in quite some time, which could be related to the infection.

The router was setting a custom DNS for google-analytics.com, which pointed to their apparently malicious server. Unfortunately, I did not realize it was DNS manipulation before I reset my router (I thought google-analytics.com was an invalid domain), so I did not get the original IP address. It servers up the script that spearheads this whole thing. The source for that script at the time of writing can be found in the file google-analytics.js

Once google-analytics runs, it inserts an iFrame that directs to http://storage.com/storage.html. The ad serving script is clever in that it will only serve you ads so many times in a given period, so that you won't be able to debug and you might not really think anything is wrong. It stores timed cookies on the storage.com

@josephwegner
josephwegner / index.html
Created May 22, 2014 18:03
topojson no mesh
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.state {
fill: #ccc;
}
.state-boundary {
fill: none;
@josephwegner
josephwegner / geofencing.md
Last active August 29, 2015 14:01
A method for generating geofences

Given a list of coordinates, I need to generate a (shorter) list of coordinates that, when connected, will create a geographical fence that contains all of the remaining coordinates.

  1. Find the relative center of all the points
  2. Sort all points by distance from center, descending. We will call this list allPoints.
  3. Create a new empty list called boundaries
  4. Iterate through allPoints, starting from the greatest distance, following this process:
  5. Check if the point is contained in the geofence defined by boundaries. If it is, skip this point. If not, continue.
  6. Insert the coordinate into boundaries.
  7. Sort boundaries so that each point is the shortest possible distance from its surrounding points (yes, this sort will happen a lot of times)
  8. boundaries is now your geofence defintion, and will contain all coordinates in allPoints