Skip to content

Instantly share code, notes, and snippets.

View samccone's full-sized avatar
🐐

Sam Saccone samccone

🐐
  • Google
  • ∆∆∆<script>alert(prompt('why'))</script>
  • X @samccone
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<title>Polymer</title>
<script src="http://polygit.org/components/webcomponentsjs/webcomponents-lite.js"></script>
<link href="http://polygit.org/polymer+v1.2.3/components/polymer/polymer.html" rel="import">
</head>
<body>
<dom-module id="x-element">
@samccone
samccone / README.md
Last active October 26, 2023 05:17 — forked from mbostock/.block
Reingold–Tilford Tree

The tree layout implements the Reingold-Tilford algorithm for efficient, tidy arrangement of layered nodes. The depth of nodes is computed by distance from the root, leading to a ragged appearance. Radial orientations are also supported. Implementation based on work by Jeff Heer and Jason Davies using Buchheim et al.'s linear-time variant of the Reingold-Tilford algorithm. Data shows the Flare class hierarchy, also courtesy Jeff Heer.

Compare to this radial layout.

--- /Users/sam/Desktop/old 2015-08-11 14:21:59.000000000 -0400
+++ /Users/sam/Desktop/new 2015-08-11 14:21:56.000000000 -0400
@@ -1,4 +1,6 @@
;(function() {
+"use strict";
+
/**
* @license
* Copyright 2015 Google Inc. All Rights Reserved.
@@ -391,41 +393,34 @@
(defn scheme [encoded]
(mod (->> (seq encoded)
(map #(-> (int %) (- 64)))
(reduce *)) 47))
(defn ride [group comet]
(if (= (scheme group) (scheme comet)) "GO" "STAY"))
@samccone
samccone / gist:db7e7acddea841916a79
Last active August 29, 2015 14:21
squared_same
(defn squared_same [a b]
(cond
; handle nil case
(or (nil? a) (nil? b)) false
; make sure the number of unique elements lines up
(not= (count (distinct a)) (count (distinct b))) false
; loop over each element of (doubled)
; if a is not present in b eager exit
; nil? is to invert the some return value to match
; the defined sped.
@samccone
samccone / Chrome 42
Created May 22, 2015 15:16
chrome 43 vs chrome 42 vs Firefox 37
This file has been truncated, but you can view the full file.
0,0.32118648290634155,0.6083372831344604,0.8310238122940063,0.9656484127044678,0.9979451894760132,0.9244917631149292,0.7530714273452759,0.5018496513366699,0.19744783639907837,-0.12787702679634094,-0.43965110182762146,-0.7048361897468567,-0.8953311443328857,-0.9909495711326599,-0.9815588593482971,-0.8681543469429016,-0.6627532839775085,-0.3871214985847473,-0.07046715915203094,0.253654420375824,0.5508967041969299,0.7897616624832153,0.944936990737915,0.9999793171882629,0.9490557312965393,0.7975623607635498,0.5615530014038086,0.2660369277000427,-0.057670533657073975,-0.3752667307853699,-0.6530967950820923,-0.8617194890975952,-0.9790269732475281,-0.9925892353057861,-0.9009686708450317,-0.7138742208480835,-0.45113205909729004,-0.1405840963125229,0.18486136198043823,0.49071717262268066,0.7445727586746216,0.9195274114608765,0.997041642665863,0.9689012169837952,0.8380882740020752,0.6184644103050232,0.3333033323287964,0.012822814285755157,-0.30901670455932617,-0.5981103181838989,-0.823823094367981,-0.9622371196746826,-
{
"scripts": {
"postInstall": "tsd query angular2 --action install && cp node_modules/systemjs/node_modules/es6-module-loader/dist/es6-module-loader.js node_modules/systemjs/dist",
"dev": "tsc --watch -m commonjs -t es5 --emitDecoratorMetadata app.ts",
"compile": "tsc -m commonjs -t es5 --emitDecoratorMetadata app.ts"
},
"devDependencies": {
"tsd": "^0.6.0",
"typescript": "^1.5.0-beta"
},
at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:198)
at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:266)
at org.gradle.cache.internal.DefaultPersistentDirectoryStore.longRunningOperation(DefaultPersistentDirectoryStore.java:135)
at org.gradle.api.internal.changedetection.state.DefaultTaskArtifactStateCacheAccess.longRunningOperation(DefaultTaskArtifactStateCacheAccess.java:95)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:31)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:86)
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
at org.g
Verifying I am +samccone on my passcard. https://onename.com/samccone