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 {createObjectCsvWriter} = require('csv-writer'); | |
// Create csv files from arrays | |
main().catch(panic); | |
// https://stackabuse.com/reading-and-writing-csv-files-with-node-js/ | |
async function main() | |
{ | |
const rows = [ |
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 | |
# Show common lines in two files | |
# https://unix.stackexchange.com/a/398143/121657 | |
# > Use comm -12 file1 file2 to get common lines in both files. |
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 csv = require('neat-csv'); | |
const fs = require('fs'); | |
const path = require('path'); | |
// Parsing csv files and strings | |
main().catch(panic); | |
// https://stackabuse.com/reading-and-writing-csv-files-with-node-js/ | |
async function main() |
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
<!-- Calculating the point of intersection of two lines --> | |
<svg id="app" xmlns="http://www.w3.org/2000/svg"> | |
<line :x1="x1" :y1="y1" :x2="x2" :y2="y2" stroke="black" /> | |
<line :x1="x3" :y1="y3" :x2="x4" :y2="y4" stroke="black" /> | |
<circle :cx="c.x" :cy="c.y" r="3" fill="red" /> | |
</svg> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/vue/2.6.10/vue.min.js"></script> | |
<script> | |
// https://stackoverflow.com/a/38977789/1478566 |
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
<div id="app"> | |
Get property values from keyframes at specific time. | |
<br> | |
<textarea v-model="keyframes" cols="50" rows="5"></textarea> | |
<br> | |
<input v-model="time" type="number" min="0" max="1" step="0.01"> | |
<pre>{{ values }}</pre> | |
</div> | |
<script src="https://unpkg.com/vue@2.6.10/dist/vue.js"></script> |
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 | |
# How to pretty print css | |
# | |
# usage | |
# $ cat a.css | ./css_pretty_format > out.css |
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 | |
# Remove prefixes from css | |
# | |
# usage | |
# $ cat a.css | ./css_autoprefixer_clean > out.css |
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 | |
# How to add prefixes to css | |
# | |
# usage | |
# $ cat a.css | ./css_autoprefixer > out.css |
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 | |
# How to minify css | |
# | |
# usage | |
# $ cat a.css | ./css_minify_optimize > out.css |
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
<?php | |
# Rounding errors in PHP | |
# docker run --rm -i php:5.6 php < php_math_float_error.php | |
# docker run --rm -i php:7.1 php < php_math_float_error.php | |
# docker run --rm -i php:7.2 php < php_math_float_error.php | |
# docker run --rm -i php:7.3 php < php_math_float_error.php | |
define('FLOAT_ERROR', 0.00001); |
NewerOlder