Skip to content

Instantly share code, notes, and snippets.

View gist:b1ca15587030a1013e4172d1f2b076ec
module.exports = {
config: {
windowPosition: [40, 40],
windowSize: [540, 380],
// default font size in pixels for all tabs
fontSize: 12,
// font family with optional fallbacks
fontFamily: 'Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace',
@stereokai
stereokai / index.css
Created Jun 18, 2017
Trigonometry in CSS
View index.css
//----------------------------------*\
// TRIGONOMETRY FUNCTIONS
//----------------------------------*/
// # Trigonometry in CSS
//
// - Through Taylor/Maclaurin polynomial representation: http://people.math.sc.edu/girardi/m142/handouts/10sTaylorPolySeries.pdf
// - Useful if you don't want to use JS.
// - With CSS Variables.
// - `calc()` can't do power (x ^ y) so I used multiplication instead.
@stereokai
stereokai / webpack.config.js
Created May 16, 2017
Sass-friendly CSS Modules
View webpack.config.js
// The motivation is to avoid having to explicitly import infrastructure Sass files
// (those containing only variables/mixins/functions etc). This enables a more classic
// Sass dev experience, with the end result still being good ol' CSS Modules.
// First, make a shared.scss file which imports all of your Sass variables, mixins and functions.
// Note that nothing in that bundle should create CSS, otherwise, that CSS will be prepended to any
// Sass file you import with CSS modules. Then:
// With Webpack 1, add a sassLoader options object to your webpack.config.js module:
module.exports = {
View .hyper.js
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 12,
// font family with optional fallbacks
fontFamily: 'Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace',
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk)
cursorColor: 'rgba(248,28,229,0.8)',
@stereokai
stereokai / gist:36dc0095b9d24ce93b045e2ddc60d7a0
Created May 10, 2016
CSS rounded corners with gradient border
View gist:36dc0095b9d24ce93b045e2ddc60d7a0
.rounded-corners-gradient-borders {
width: 300px;
height: 80px;
border: double 4px transparent;
border-radius: 80px;
background-image: linear-gradient(white, white), radial-gradient(circle at top left, #f00,#3020ff);
background-origin: border-box;
background-clip: content-box, border-box;
}
@stereokai
stereokai / index.js
Last active May 1, 2020
Real, precise, futureproof javascript browser detection
View index.js
// Opera 8.0+ (UA detection to detect Blink/v8-powered Opera)
isOpera = !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
// Firefox 1.0+
isFirefox = typeof InstallTrigger !== 'undefined';
// At least Safari 3+: "[object HTMLElementConstructor]"
isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0;
// At least IE6
isIE = /*@cc_on!@*/false || !!document.documentMode;
// Edge
isEdge = !!window.MSAssertion;
@stereokai
stereokai / index.js
Last active Jan 17, 2016
Cross browser body scrollTop
View index.js
function getScrollTop() {
return (isBlink || isSafari || isEdge) ? document.body.scrollTop
: document.documentElement.scrollTop;
}
function setScrollTop(scrollTop) {
if (isBlink || isSafari || isEdge) {
document.body.scrollTop = scrollTop;
} else {
document.documentElement.scrollTop = scrollTop;
@stereokai
stereokai / gist:82ea6fe3959a7d0879af
Last active Aug 29, 2015
Javascript: dynamic name function with eval()
View gist:82ea6fe3959a7d0879af
looper = eval('(function () { return \
function ' + (request.name ? request.name + 'Looper' : 'looper') + ' (timestamp, startTime) { \
if (_locks.global || _locks[request.namespace] || _locks[request._fid]) return; \
\
request(timestamp, startTime); \
} \
})()');
You can’t perform that action at this time.