Skip to content

Instantly share code, notes, and snippets.

@josephwegner
josephwegner / generator.js
Last active August 29, 2015 13:55
CSS Selector Generator
var currentElement = false;
window.addEventListener("mousemove", function(e) {
var newElement = document.elementFromPoint(e.x, e.y);
if(newElement != currentElement) {
if(currentElement) {
currentElement.style["background-color"] = "white";
}
@josephwegner
josephwegner / svg.md
Last active August 29, 2015 13:55
SVG Markdown for Flippin Awesome
title Learning SVG With Logos
layout tutorial
meta
_edit_last dsq_thread_id
1
learningsvgwithlogos
tutorialbg #05051f
message It seems that Google Chrome has some trouble looping SVG animations. If you're interested in the examples, you may want to view this page in Firefox
(function () {
var a = translated_warning_string;
var b = function (d) {
d = d || window.event;
var c = d.target || d.srcElement;
if (c.type == "password") {
if (confirm(a)) {
b = function () {}
} else {
c.value = "";
@josephwegner
josephwegner / scope.md
Last active August 29, 2015 13:56
Lessonnote Classrooms Group Scope

ToDo

App

  • Classroom download modal needs to show more information (owner) [1h]
  • Lesson download modal needs to show more information (owner) [1h]
  • Classroom download modal should specify my classrooms vs. group classrooms [2.5h]
  • Lesson download modal should specify my lessons vs. group lessons [2.5h]
  • Downloading a parent classroom should create a copy parent classroom that is owned by the current user [1h]
  • App needs to recognize hidden/parent UUID fields when downloading classrooms [1.5h]
  • Handle error messages better [3h]
@josephwegner
josephwegner / test.html
Last active August 29, 2015 13:56
Sysinct Demo
<!-- Create this file, open it in a browser, then open your console. Go to http://pullup.io, and watch your console -->
<html>
<head>
<title>Test</title>
<script src="http://sysinct.herokuapp.com/socket.io/socket.io.js"></script>
<script type="text/javascript">
var socket = io.connect("http://sysinct.herokuapp.com");
socket.emit('subscribe', 'pullup');
socket.on('log', function(data) {
console.log('log', data);
@josephwegner
josephwegner / SassMeister-input.sass
Created April 23, 2014 18:42
Generated by SassMeister.com.
// ----
// Sass (v3.3.5)
// Compass (v1.0.0.alpha.18)
// ----
$colors: (
header: #b06,
text: #334,
footer: #666777,
)
@josephwegner
josephwegner / SassMeister-input.sass
Created April 23, 2014 18:48
Generated by SassMeister.com.
// ----
// Sass (v3.3.5)
// Compass (v1.0.0.alpha.18)
// ----
$merchant_images: ( king-kone: 'king-kone', alley_cat_comics: 'alley_cat_comics', robert_jeffrey: 'robert_jeffrey', berry_austin: 'berry_austin', dogaholics: 'dogaholics', barriques: 'barriques', rotofugi: 'rotofugi', chicago_bagel_authority: 'chicago_bagel_authority')
@each $merchant, $image in $merchant_images
.#{$merchant}
background-image: url(#{$image}.jpg)
### Keybase proof
I hereby claim:
* I am josephwegner on github.
* I am josephwegner (https://keybase.io/josephwegner) on keybase.
* I have a public key whose fingerprint is BB85 D9FF 4F83 D4E2 3F0D DCC9 DD75 1D23 F0E8 F0C1
To claim this, I am signing this object:
  • Figure out wormholes
    • Call @arfon
    • Research (docs)
    • Build prototype #15
    • Test run #43 @world-domination/time-travel
  • ...?
  • Profit!
@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