Skip to content

Instantly share code, notes, and snippets.

View Rayraegah's full-sized avatar
☄️
Curiosity is about annihilating itself; it doesn't seek a response.

Severan Rayraegah

☄️
Curiosity is about annihilating itself; it doesn't seek a response.
View GitHub Profile
@Rayraegah
Rayraegah / AspectRatio.js
Last active August 29, 2015 14:00
Image aspect ratio
function calculateAspectRatioFit(srcWidth, srcHeight, maxWidth, maxHeight) {
var ratio = Math.min(maxWidth / srcWidth, maxHeight / srcHeight);
return { width: srcWidth*ratio, height: srcHeight*ratio };
}
@Rayraegah
Rayraegah / data.json
Last active August 29, 2015 14:03
Ajax xhr request
{"foo": 1, "bar": 2}
@Rayraegah
Rayraegah / appcache.js
Created July 11, 2014 08:33
Application Cache
window.addEventListener('load', function(e) {
log("Window <em>load</em> event");
var appCache = window.applicationCache;
// Fired after the first cache of the manifest.
appCache.addEventListener('cached', handleCacheEvent, false);
// Checking for an update. Always the first event fired in the sequence.
@Rayraegah
Rayraegah / gradients.json
Created September 10, 2014 09:34
Pretty and Colourful Gradients
[
{
"name":"Emerald Water",
"colour1":"#348F50",
"colour2":"#56B4D3"
},
{
"name":"Lemon Twist",
"colour1":"#3CA55C",
"colour2":"#B5AC49"
@Rayraegah
Rayraegah / debug-css.js
Created October 7, 2014 10:24
CSS Debugging
[].forEach.call(document.querySelectorAll("*"),function(a){a.style.outline="1px solid #"+(~~(Math.random()*(1<<24))).toString(16)})
@Rayraegah
Rayraegah / senpai.js
Last active August 29, 2015 14:10
senpai will notice me
/**
* senpai.js v1.0.1
* @description A document ready state event handler and dispatcher.
* @author Rayraegah Ownsu
* @usage bodyIsReady(fn); || bodyIsReady(function () {...}); || bodyIsReady(fn, args); || bodyIsReady(function (args) {...}, ctx);
*
* ===========
* Change log:
* ===========
* v1.0.1
@Rayraegah
Rayraegah / index.html
Last active August 29, 2015 14:10 — forked from anonymous/index.html
<div class="loadcenter">
<div class="loadcenter_wrap">
<svg class="l1" width="320px" height="320px">
<path d="M160,0.5C212.9,53.4,319.5,160,319.5,160 L160,319.5L0.5,160L160,0.5z"></path>
</svg>
<svg class="l2" width="320px" height="320px">
<path d="M160,40.5C184,64.5,279.5,160,279.5,160 L160,279.5L40.5,160L160,40.5z"></path>
</svg>
<svg class="l3" width="320px" height="320px">
<path d="M160,80.5c21.7,21.7,79.5,79.5,79.5,79.5 L160,239.5L80.5,160L160,80.5z"></path>
@Rayraegah
Rayraegah / index.html
Last active August 29, 2015 14:16
Heathrow Meta tags
<!--
A sample html document that describes how to implement Facebook Open Graph tags and Structuring data for SEO and other social networks. This document was created for Heathrow Airport as a sample for use in http://www.heathrowairport.com
2015, Severan Rye (https://rayraegah.github.io)
USEFUL LINKS
============
* Facebook for Domains - https://developers.facebook.com/docs/platforminsights/domains
* OG Meta types - http://ogp.me/
* Structured data - https://developers.google.com/structured-data/

Keybase proof

I hereby claim:

  • I am rayraegah on github.
  • I am rayraegah (https://keybase.io/rayraegah) on keybase.
  • I have a public key whose fingerprint is 4023 469C 167F BE02 AAF0 7018 42F5 B157 BB45 09F9

To claim this, I am signing this object:

@Rayraegah
Rayraegah / a.html
Last active August 29, 2015 14:27 — forked from mbostock/.block
D3 PJAX
<!DOCTYPE html>
<html>
<body>
<div id="main">
<ul>
<li><b>Anteater</b></li>
<li><a href="b.html">Baobao</a></li>
<li><a href="c.html">Cuttlefish</a></li>
</ul>
Anteaters, also known as antbear, are the four mammal species of the suborder Vermilingua (meaning "worm tongue") commonly known for eating ants and termites. Together with the sloths, they compose the order Pilosa. The name "anteater" is also colloquially applied to the unrelated aardvark, numbat, echidna, and pangolin.