Skip to content

Instantly share code, notes, and snippets.

View ivancuric's full-sized avatar

Ivan Čurić ivancuric

  • Mircroblink
  • Zagreb, Croatia
  • X @_baxuz
View GitHub Profile
@ivancuric
ivancuric / refresh-rate.js
Created March 27, 2017 12:17
Method for finding out the refresh rate of the device
function _getRefreshRate() {
const rafPromise = _ => new Promise(requestAnimationFrame);
const idlePromise = _ => new Promise(requestIdleCallback);
let f1, f2;
return new Promise(resolve => {
idlePromise()
.then(_ => rafPromise())
.then(frame => {f1 = frame; return rafPromise();})
@ivancuric
ivancuric / settings.json
Created March 10, 2017 09:46
VScode settings
// Place your settings in this file to overwrite the default settings
{
"editor.fontFamily": "Input",
"editor.fontSize": 14,
"terminal.integrated.fontLigatures": true,
"terminal.integrated.fontSize": 14,
"editor.wordWrap": "on",
"editor.minimap.enabled": true,
"editor.minimap.renderCharacters": false,
"editor.fontLigatures": true,
@ivancuric
ivancuric / _mixins.scss
Created March 10, 2017 09:06
SCSS utilities
/* Unless said otherwise, logic is min-width */
/* Hard column width */
@function colw($n, $gutter: $gutter) {
@return $n * ($col + $gutter);
}
/* Strip units */
@function strip($value) {
@return $value / ($value * 0 + 1);