Skip to content

Instantly share code, notes, and snippets.

View sackeyjason's full-sized avatar

Jason Sackey sackeyjason

View GitHub Profile
@sackeyjason
sackeyjason / gist:9060806
Last active August 29, 2015 13:56
Sass exporter for Color Scheme Designer
console.log((Array.prototype.map.call(document.querySelectorAll(
'.sample .white strong'), function(v, i) { return ('$' + ((i < 5) ? 'prime' :
'comp') + ['', '-dark', '-darker', '-light', '-lighter'][i % 5] + ': #' +
v.innerHTML + ';'); })).join('\n'));
/*
1. Go to http://colorschemedesigner.com/ and make a palette
2. You have to use the *complement* mode
3. Click Export -> HTML+CSS (top-right)
4. Paste the above into your console
@sackeyjason
sackeyjason / SassMeister-input.scss
Created September 12, 2014 10:21
Generated by SassMeister.com.
// ----
// Sass (v3.3.14)
// Compass (v1.0.1)
// ----
.club {
color: black;
font-size: 30px;
}
@sackeyjason
sackeyjason / SassMeister-input-HTML.html
Created February 21, 2015 11:09
Generated by SassMeister.com.
<div class="row">
<div class="c-third"><div class="hi"></div></div>
<div class="c-third"><div class="hi"></div></div>
<div class="c-third"><div class="hi"></div></div>
</div>
<div class="row">
<div class="c-quarter"><div class="hi"></div></div>
<div class="c-quarter"><div class="hi"></div></div>
<div class="c-quarter"><div class="hi"></div></div>
<div class="c-quarter"><div class="hi"></div></div>
@sackeyjason
sackeyjason / Procfile
Created June 13, 2015 17:09
Attempt to run fedwiki on heroku
web: npm run wiki
@sackeyjason
sackeyjason / Procfile
Last active August 29, 2015 14:23
Running Fedwiki on Heroku
web: wiki --port $PORT -u http://my-app.herokuapp.com/ --database '{"type": "redis", "host": "my-redis-host-url", "port": 0000, "options": { "auth_pass": "my-password"}}'
@sackeyjason
sackeyjason / mq-pixels.scss
Created December 1, 2015 11:54
Guardian's mq plugin, modified. Easily manage media queries. With pixels.
@charset "UTF-8";
// Modified to give pixel units, instead of converting to em units
$give-pixel-units: true;
// To enable support for browsers that do not support @media queries,
// (IE <= 8, Firefox <= 3, Opera <= 9) set $mq-responsive to false
// Create a separate stylesheet served exclusively to these browsers,
// meaning @media queries will be rasterized, relying on the cascade itself
$mq-responsive: true !default;
@sackeyjason
sackeyjason / low-friction-publishing.md
Last active December 10, 2018 22:33
Low-friction publishing

What's this?

A list of free web services providing text editing, online publishing, without any signup requirement (but they may require third-party signing in)

URL Name Signup/account required? Notes Example publication
https://pastebin.com/ Pastebin No The original. Plain text, optional code highlighting. Lots of ads. https://pastebin.com/ZbR0jPmd
http://piratepad.net/front-page/ PiratePad No Running Etherpad: real-time collaborative editing. Intermittent uptime.
http://pen.io/ Pen.io No When thi
@sackeyjason
sackeyjason / Ackermann.js
Last active July 8, 2019 04:53
Ackermann–Péter function, with and without recursion. Faster without!
// "Canonical", recursive
const ap = (m, n) => {
if (m === 0) return n + 1;
if (m > 0 && n === 0) return ap(m - 1, 1);
if (m > 0 && n > 0) return ap(m - 1, ap(m, n - 1));
};
// Non-recursive. Faster, and won't exceed call stack size!
// But maybe the array will get too huge.
const ap2 = (m, n) => {
{ "Access-Control-Allow-Origin": "*" }
@sackeyjason
sackeyjason / frontend.js
Last active May 5, 2020 16:19
CORS begin
const ROOT = "http://localhost:3333";
await fetch(ROOT + "/wiki", {
method: "POST",
body: JSON.stringify({
title: "wiki",
page: ["content"]
}),
headers: {
"Content-Type": "application/json"