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 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
<!-- Rendering charts with chart.js --> | |
<div style="position:absolute; top:0; left:0; width:100%; height:100%;"> | |
<canvas id="canvas" style="width:100%; height:100%;"></canvas> | |
</div> | |
<script src="https://unpkg.com/[email protected]/dist/Chart.min.js"></script> | |
<script> | |
new Chart(document.getElementById('canvas').getContext('2d'), { | |
type: 'line', // line|bar |
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 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
<!-- Scale a point around origin --> | |
<!-- https://codepen.io/vbarbarosh/pen/OYrdxK --> | |
<svg> | |
<circle id="orig" cx="200" cy="150" r="10" /> | |
<circle id="a" cx="25" cy="25" r="5" fill="#8f8" /> | |
<circle id="b" cx="150" cy="25" r="5" /> | |
</svg> | |
<style> |
This file contains 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
<!-- Rotate a point around origin --> | |
<!-- https://codepen.io/vbarbarosh/pen/joXEyR --> | |
<svg> | |
<circle id="origin" cx="200" cy="150" r="10" /> | |
<circle id="point" cx="175" cy="125" r="5" /> | |
</svg> | |
<style> | |
svg { |
This file contains 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
const Promise = require('bluebird'); | |
const fs = require('fs'); | |
const util = require('util'); | |
// Ways to promisify a function | |
// $ node node_promise_promisify.js | |
// https://nodejs.org/api/util.html#util_util_promisify_original | |
const fs_open = util.promisify(fs.open); |
This file contains 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
const Promise = require('bluebird'); | |
// How Promise.then is designed to work | |
// $ node node_promise_then.js | |
main().catch(panic); | |
async function main() | |
{ | |
// FULFILLED |
This file contains 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
// How to work with Buffer | |
main().catch(panic); | |
async function main() | |
{ | |
// Use this if buffer will be immediately written to | |
Buffer.allocUnsafe(1024); | |
// Use this to allocate memory filled with zeroes |
This file contains 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
#!/bin/bash | |
# http://www.gnu.org/software/bash/manual/bash.html#The-Set-Builtin | |
# http://redsymbol.net/articles/unofficial-bash-strict-mode/ | |
set -o nounset -o errexit -o pipefail | |
# Merge several .woff2 files into a single one. Primary use case is to | |
# feed resulted file to a svgtext app. | |
# | |
# https://github.com/fonttools/fonttools |