Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name gist logs | |
// @namsgpace https://www.hatena.ne.jp/noromanba/ | |
// @description Show commit logs on Gist for Greasemonkey | |
// @include https://gist.github.com/* | |
// @grant GM_xmlhttpRequest | |
// @version 2012.10.12.2 | |
// @license WTFPL http://sam.zoy.org/wtfpl/ (Do What The Fuck You Want To Public License) | |
// @contributor satyr https://gist.github.com/107780 | |
// @contributor saitamanodoruji https://gist.github.com/2653937 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function intersections(a, b) { | |
var R = a.r, | |
r = b.r, | |
dx = b.x - a.x, | |
dy = b.y - a.y, | |
d = Math.sqrt(dx * dx + dy * dy), | |
x = (d * d - r * r + R * R) / (2 * d), | |
y = Math.sqrt(R * R - x * x); | |
dx /= d; | |
dy /= d; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Builds a list of background image urls from inline styles / linked stylesheets | |
* | |
* @return {array} | |
* Array of unique absolute image URLs from inline styles/readable style sheets | |
*/ | |
function getBackgroundImages(doc) { | |
doc = doc || document; | |
var sheets = doc.styleSheets | |
, url_re = /\burl[(\s]+['"]?([^"')]+)["']?[\s)]+/g | |
, _slice = Array.prototype.slice |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// iOS Media Queries | |
// Goal: capture styles for iPhone, -3G, -3GS, -4, -4S, iPad, -2 and -3 | |
// | |
// Author: Tony Schneider (@tonywok) | |
// Please tell me where I fail. :) | |
// iPhone v(4,4S) portrait | |
// test: black text (overwritten by v* portrait) with blue background | |
@media all and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait) { | |
a { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<script src="http://d3js.org/d3.v2.js?2.9.1"></script> | |
<svg viewBox="0 0 2000 1625.4" width="960" height="500"> | |
<path fill="#52ade5" d="m2e3 192.42c-73.58 32.64-152.67 54.69-235.66 64.61 84.7-50.78 149.77-131.19 180.41-227.01-79.29 47.03-167.1 81.17-260.57 99.57-74.84-79.75-181.48-129.57-299.5-129.57-226.6 0-410.33 183.71-410.33 410.31 0 32.16 3.63 63.48 10.63 93.51-341.02-17.11-643.37-180.47-845.74-428.72-35.32 60.6-55.56 131.09-55.56 206.29 0 142.36 72.44 267.95 182.54 341.53-67.26-2.13-130.54-20.59-185.85-51.32-.04 1.71-.04 3.42-.04 5.16 0 198.8 141.44 364.64 329.15 402.34-34.43 9.38-70.68 14.4-108.1 14.4-26.44 0-52.15-2.58-77.2-7.36 52.22 163.01 203.75 281.65 383.3 284.95-140.43 110.06-317.35 175.66-509.6 175.66-33.12 0-65.79-1.95-97.88-5.74 181.59 116.42 397.27 184.36 628.99 184.36 754.73 0 1167.46-625.24 1167.46-1167.47 0-17.79-.41-35.48-1.2-53.08 80.18-57.86 149.74-130.12 204.75-212.41"/> | |
</svg> | |
<script> | |
var svg = d3.select("svg"), | |
path = svg.select("path") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Here's how to add a coloured marker to a Google Map with a shadow in the | |
right place. | |
The pin itself used to be dynamically generated via Google Charts: | |
//chart.apis.google.com/chart?chst=d_map_pin_letter&chld=|3491FF|000000 | |
documented here: | |
https://developers.google.com/chart/image/docs/gallery/dynamic_icons | |
Note however that this API was marked as deprecated on April 20th 2012 | |
although it's not clear when or if it will be turned off. |