Instantly share code, notes, and snippets.

View rename_images.sh
exif_date () { exiv2 -g Exif.Image.DateTime -Pv "$1" | tr ':' '-' | tr ' ' '_'; }
exif_make () { exiv2 -g Exif.Image.Make -Pv "$1"; }
n=$(ls *[jJ[pP][gG] | wc -l)
m=0
for i in *[jJ][pP][gG]; do
(( m = m + 1 ))
j="$(exif_date $i)_$(exif_make $i).jpg"
echo -n "$m/$n: $i -> $j"
mv "$i" "$j"
View .gitlab-ci.yml
image: maven:3.5-jdk-8
variables:
DEPS: "software/cplex-wrapper"
GIT_SUBMODULE_STRATEGY: recursive
stages:
- publish
publish:
View abstract-classes.js
function abstract (...methods) {
return Object.assign(function () { }, {
prototype: methods.reduce((x, m) => {
x[m] = function () {
throw new Error(`method ${m} is abstract`)
}
return x
}, {})
})
}
View frontendDevlopmentBookmarks.md
View gist:682765e711a088f0fe13
function sum(a){ var s = 0, i = 0, l = a.length; for (;i<l;i++) s+= f(a[i], i, a); return s;}
function sq(a){return a*a}
// https://controls.engin.umich.edu/wiki/index.php/Basic_statistics:_mean,_median,_average,_standard_deviation,_z-scores,_and_p-value#Mean_and_Weighted_Average
function mean(a){var s = 0, i = 0, l = a.length; for (;i<l;i++) s+=a[i]; return s / l;}
function wMean(w, a){ var z = 0, n = 0, i = 0, l = a.length; for (;i<l;i++){n+=w[i];z+=a[i]*w[i];};return z / n;}
// https://controls.engin.umich.edu/wiki/index.php/Basic_statistics:_mean,_median,_average,_standard_deviation,_z-scores,_and_p-value#Median
function median(a){var l = a.length, b = arr.slice().sort(); return l % 2 === 0 ? ((b[l /2 - 1] + b[l / 2]) / 2) : b[l / 2];}
View name-badge.html
<template name="name-badge">
<script src="https://cdnjs.cloudflare.com/ajax/libs/less.js/2.5.0/less.js"></script>
<link rel="stylesheet/less" type="text/css" href="https://gist.githubusercontent.com/lordvlad/735d304037070a8fe999/raw/f69204c51c45d53747a883974e5e4474351380ce/name-badge.less"/>
<div class="outer zoom">
<div class="inner">
Hi! My name is
</div>
<div class="name">
<content></content>
View name-badge.less
.outer.zoom {
transform: scale(0.5);
}
.outer {
transform: scale(1.0);
transition-property: transform;
transition-duration: 400ms;
border: 2px solid brown;
border-radius: 1em;
background: red;
View index.js
/*
* sets globals __line, __file, __ext, __dir and __function
* influences
* http://goo.gl/wwjGVV and http://goo.gl/umq4s1
* https://gist.github.com/gavinengel/8572856
* https://github.com/kvz/phpjs/tree/master/experimental/language
* todo: __method, __class/__constructor
*/
// begin setting magic properties into global (required for other functions)
View index.html
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
img {
width: 30px;
height: 30px;
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
function LList(data) {