View timer.sh
timer () {
sleep $1 | pv -t
}
View locafox.sql
SELECT
IF(`s_articles_details`.`kind` = 1, SUBSTRING_INDEX(`s_articles_details`.`ordernumber`, '.', 1), '') as `Artikelnr. SKU`,
`s_articles_details`.`ordernumber` as `Varianten SKU`,
`s_articles_details`.`ean` as `GTIN/EAN/ISBN`,
LEFT(IF(`s_articles_details`.`kind` = 1, `s_articles`.`name`, ''), 80) as `Produktbezeichnung`,
LEFT(CONCAT(`s_articles`.`name`, ' ', `s_articles_details`.`additionaltext`), 80) as `Variantenbezeichnung`,
IF(
`mainimg_media`.`path` IS NOT NULL
AND `s_articles_details`.`kind` = 1,
CONCAT(@shopwaredomain, `mainimg_media`.`path`),
View Text Substitutions.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>phrase</key>
<string>‽</string>
<key>shortcut</key>
<string>?!</string>
</dict>
View dewpoint.php
<?php
function dewpoint($temperature, $humidity){
$k2 = 17.62;
$k3 = 243.12;
$up = ($k2 * $temperature) / ($k3 + $temperature) + log($humidity);
$down = ($k2 * $k3) / ($k3 + $temperature) - log($humidity);
return $k3 * ($up / $down);
}
View dumpstatus.py
#!/usr/bin/env python3
import sys
import time
import re
def main():
try:
starttime = time.time()
buff = ''
add = ''
View ssh
#!/usr/bin/env bash
###
# call `SSH_SCREEN=1234 ./ssh user@host` to connect to screen 1234
# for example when there are multiple detached sessions with the same name
###
#set -o xtrace #debug
set -o nounset
View inlinefile.sh
#!/usr/bin/env bash
#set -o xtrace #debug
set -o nounset
set -o errexit
set -o pipefail
infile=${1}
View cryptMailto.js
function CryptMailto(s)
{
var r = "";
var n = Math.round(Math.random() * 89 + 10);
console.log("n: " + n);
for(var i = 0; i < s.length; i++)
{
c = s.charCodeAt(i) + n;
if(c >= 126){
c -= 93;
View lesswatch.sh
#!/usr/bin/env bash
# fswatch: https://github.com/emcrisostomo/fswatch
#####
# Example:
# lesswatch.sh . main.less ../css/main.css
#
# watches for changes in folder `.` and invokes the less compiler with the primary less file `main.less` and writes output to `../css/main.css`
# source and target folders should not be the same. fswatch will notice changes in the compiled css file and recompile. again. and again. and again...
#####
fswatch -0 $1 | while read -d "" event; do echo -n `date "+%Y-%m-%d %H:%M:%S -"`; echo " ${event}"; lessc --clean-css $2 $3; done
View bash.sh
#!/usr/bin/env bash
set -o xtrace #debug
set -o nounset
set -o errexit
set -o pipefail
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
__file="${__dir}/$(basename "${BASH_SOURCE[0]}")"