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
#!/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 | |
# Add a timestamp to beginning of each line | |
# The fastest | |
# https://unix.stackexchange.com/a/26797/121657 |
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
// Make a string safe to put into html | |
// https://stackoverflow.com/a/6234804/1478566 | |
// | |
// Consider using https://github.com/mathiasbynens/he for production | |
function html_escape(s) | |
{ | |
return s | |
.replace(/&/g, '&') | |
.replace(/</g, '<') | |
.replace(/>/g, '>') |
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 |
NewerOlder