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
;(function() { | |
var images = [].slice.call(document.querySelectorAll('img')) | |
try { | |
images.forEach(function(img) { | |
downloadImage(img) | |
}) | |
} catch (e) { | |
alert("Download failed."); | |
console.log('Download failed.', e); | |
} |
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
placeholder |
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
<!doctype html> | |
<html class="no-touch no-js"> | |
<head> | |
<script> /* PUT `no-x.js` here, as early as possible, before any other CSS or JS calls ... */ </script> | |
</head> | |
... |
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 | |
# Usage: | |
# ./ffmpegconcat.sh input1.mp4 input2.mp4 input3.mp4 output.mp4 | |
# See: https://trac.ffmpeg.org/wiki/Concatenate | |
for input in "${@:1:$#-1}"; do echo "file '$input'"; done > filelist.txt | |
ffmpeg -f concat -safe 0 -i filelist.txt -c copy "${@: -1}" | |
echo "Concatenated:" && cat filelist.txt && rm -f filelist.txt |
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
# ---------------------------------- | |
# Colors | |
# ---------------------------------- | |
NOCOLOR='\033[0m' | |
RED='\033[0;31m' | |
GREEN='\033[0;32m' | |
ORANGE='\033[0;33m' | |
BLUE='\033[0;34m' | |
PURPLE='\033[0;35m' | |
CYAN='\033[0;36m' |
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/sh | |
URL="${2}" | |
NAME="$(echo "${URL}" | sed 's#.*/\([^/]*\)/$#\1#')" | |
pgrep -f "/${NAME}-.*/playlist.m3u8" && exit | |
STREAM="$(curl -s "${URL}" | grep hlsSourceFast | sed -n 's#.*\(https://.*/playlist.m3u8\).*#\1#p')" | |
ROOT_DIR=$HOME/x | |
case "${1}" in | |
vlc|v) |
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
### Basic ### | |
# The directory to store the downloaded file. | |
dir=${HOME}/Downloads | |
# Downloads the URIs listed in FILE. | |
input-file=${HOME}/.aria2/aria2.session | |
# Save error/unfinished downloads to FILE on exit. | |
save-session=${HOME}/.aria2/aria2.session | |
# Save error/unfinished downloads to a file specified by --save-session option every SEC seconds. If 0 is given, file will be saved only when aria2 exits. Default: 0 | |
save-session-interval=60 | |
# Set the maximum number of parallel downloads for every queue item. See also the --split option. Default: 5 |
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
<!-- posts.json must be at root level --> | |
{{ $items := getJSON "posts.json" }} | |
{{ range $item := $items }} | |
<a href="{{ $item.url }}">{{ $item.name }}</a> | |
{{ end }} |
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
gulp.task("watch-upload", function() { | |
gulp.watch("src/**/*", function(obj) { | |
if(["changed", "added"].indexOf(obj.type) !== -1) { | |
gulp.src(obj.path, {"base": "src/"}) | |
.pipe(sftp(config.sftp)); | |
} | |
}); | |
}); |
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
<h1>Masonry - imagesLoaded progress, vanilla JS</h1> | |
<div class="grid"> | |
<div class="grid-sizer"></div> | |
<div class="grid-item"> | |
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/82/orange-tree.jpg" /> | |
</div> | |
<div class="grid-item"> | |
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/82/submerged.jpg" /> | |
</div> |
NewerOlder