This file contains hidden or 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
| console.clear(); | |
| // https://fonts.google.com/?subset=latin-ext&category=Sans+Serif ; get list from here | |
| // run it from the console; when run for first time uncomment the line below and comment the subsequent line; for the next runs just use the script as is here | |
| // var latin = []; | |
| var latin = latin || []; | |
| var nodes = document.querySelectorAll('h1.fonts-module-title'); | |
| Array.prototype.forEach.call(nodes, function(nod){ | |
| var font = nod.textContent.trim("\n"); | |
| if (latin.indexOf(font) == -1) latin.push(font); | |
| }); |
This file contains hidden or 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
| for f in *.jpg; do wh=$(convert "$f" -ping -format '%w %h' info:); w="${wh%\ *}"; h="${wh#*\ }";[[ h -gt w ]] && echo portrait && mogrify -rotate -90 "$f" || echo landscape; mogrify -resize 220x -gravity center -crop 220x122 done |
This file contains hidden or 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
| for f in *; do inkscape "$f" -z --export-dpi=300 --export-area-drawing --export-png="$f.png"; done |
This file contains hidden or 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
| var Heart = function(pulse){ | |
| return { | |
| id: null, | |
| periodical: function(beat){ | |
| this.id = setInterval(pulse, beat); | |
| console.log('interval ' + this.id); | |
| return this; | |
| }, | |
| stop: function(span){ |
This file contains hidden or 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 | |
| path=$(realpath ${1:-.}) | |
| parallel=${2:-8} | |
| directory= | |
| for list in $(find "$path" -wholename "*/.list") | |
| do | |
| # .ignore file exists? | |
| directory="${list%/*}" | |
| if [ -f "$directory"/.ignore ]; then |
This file contains hidden or 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
| cat .list | xargs -I % -P 10 wget -t 3 --header="Accept: text/html" --user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20100101 Firefox/21.0" ‐‐referer="https://www.google.com" % |
This file contains hidden or 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
| javascript:void(function() { | |
| document.title = "List images"; | |
| var links = document.querySelectorAll('div[data-ved]>a'); | |
| var link = ""; | |
| var href = ""; | |
| var found = []; | |
| for(var inx = 0, len = links.length; inx < len; inx++) { | |
| link = links[inx]; | |
| if ( ! href in link) continue; | |
| href = link.href; |
This file contains hidden or 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 | |
| root=~/Projects/printuridigital.ro | |
| src=$root/src | |
| dist=$root/dist | |
| what=$1 | |
| options_s3=$2 | |
| if [ -z $1 ]; then echo need file argument; exit; fi | |
| type=${1##*.} | |
| file_src=$src/$type/$what | |
| file_min=$dist/$type/$what |
This file contains hidden or 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
| # rename files | |
| i=0; for f in * ; do ((i++)); mv ./"$f" ./"<prefix-name>"$i.jpg ; done |
This file contains hidden or 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
| // Returns first element that matches CSS selector {expr}. | |
| // Querying can optionally be restricted to {container}’s descendants | |
| function $(expr, container) { | |
| return typeof expr === "string"? (container || document).querySelector(expr) : expr || null; | |
| } | |
| // Returns all elements that match CSS selector {expr} as an array. | |
| // Querying can optionally be restricted to {container}’s descendants | |
| function $$(expr, container) { | |
| return [].slice.call((container || document).querySelectorAll(expr)); |