Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
########################################
# BASH DEPENDENCY CHECKER
########################################
# create an array of packages depended on
declare -a DEPENDENCIES=(
'pwd' 'curl' 'missing-package'
)
@sh78
sh78 / .htpasswd
Last active December 30, 2015 02:58
AuthName "Secure Area"
AuthType Basic
AuthUserFile /path/to/your/directory/.htpasswd
require valid-user
^(.*)(\r?\n\1)+$
^[^THIS|THAT].*
# credit to http://www.artificialworlds.net/blog/2012/10/17/bash-associative-array-examples/
# Basics
declare -A MYMAP # Create an associative array
MYMAP[foo]=bar # Put a value into an associative array
echo ${MYMAP[foo]} # Get a value out of an associative array
# => bar
echo MYMAP[foo] # WRONG
# => MYMAP[foo]
function myfunc --description "Basic Function. Args Are Built In"
echo $argv
echo $argv[1] $argv[2] # no zero indices in the ocean...
end
# └> myfunc one two three
# one two three
# one two two
function myfunc --description "Basic Function With Variables"
<table>
<thead>
<tr>
<th scope="col">DATA1</th>
<th scope="col">DATA2</th>
<th scope="col">DATA3</th>
</tr>
</thead>
<tfoot>
<tr>
<!-- SVG spritemap definition & usage example -->
<!--
Define Some SVGs
External .svg file recommended, or inline below opening <body>
-->
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol id="icon1" viewBox="0 0 161.4 188.9">
<title>For Screenreaders</title>
/* use a CSS selector to change the value of multiple text inputs on a page with the browser console */
// Enter a css selector to operate on
var theSelectorIsHere = 'TYPE_HERE';
// Enter desired value
var whatItShouldBe = 'TYPE_HERE';
// Don't worry about this part, paste in the the browser console
var whereItShouldBe = document.querySelectorAll(theSelectorIsHere);
<video controls preload="metadata" autoplay loop muted poster="poster_image.png">
<source src="video_file.mp4" type="video/mp4">
<source src="video_file.ogg" type="video/ogg">
<!--
Accessibility: Include valid WEBVTT caption file(s)
https://developer.mozilla.org/en-US/Apps/Build/Audio_and_video_delivery/Adding_captions_and_subtitles_to_HTML5_video
https://quuz.org/webvtt/
-->
<track label="English" kind="subtitles" srclang="en" src="subtitles-en.vtt" default>
<track label="Director's Commentary In German" kind="captions" srclang="de" src="commentary-de.vtt">