Skip to content

Instantly share code, notes, and snippets.

@cinatic
cinatic / watch.sh
Created October 6, 2023 09:20
watch function with expanded alias
watch1 (){
firstArg=$1
shift;
rest=$@
resolvedCmd=$(alias $firstArg 2>/dev/null | cut -d\' -f2)
if [ -z "$resolvedCmd" ]; then
resolvedCmd=$firstArg
fi
@cinatic
cinatic / extractMkvSubtitles.sh
Last active December 12, 2022 17:05
Extract Subtitles from mkv
#!/bin/bash
# Extract subtitles from each MKV file in the given directory
# If no directory is given, work in local dir
if [ "$1" = "" ]; then
DIR="."
else
DIR="$1"
fi
@cinatic
cinatic / gist:b8fe352ad4e3ff05f71f
Created January 19, 2015 13:40
Full demo page
<!--http://jsfiddle.net/sgxKJ/-->
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>
Examples - Select2
</title>
incomplete_results: false
items: [{id: 22988836, name: "Karlsruhe", full_name: "Aushilfe-6/Karlsruhe",…},…]
0: {id: 22988836, name: "Karlsruhe", full_name: "Aushilfe-6/Karlsruhe",…}
1: {id: 2301036, name: "karlsruhe", full_name: "mylifenp/karlsruhe",…}
2: {id: 27330352, name: "karlsruhe", full_name: "friedger/karlsruhe",…}
3: {id: 10148245, name: "Vorlesungsverzeichnis", full_name: "Jupiterrr/Vorlesungsverzeichnis",…}
4: {id: 19499970, name: "Karlsruhe2", full_name: "inovexAcademy/Karlsruhe2",…}
5: {id: 19499985, name: "Karlsruhe3", full_name: "inovexAcademy/Karlsruhe3",…}
6: {id: 8861008, name: "2013", full_name: "DevCampKarlsruhe/2013",…}
7: {id: 19500008, name: "Karlsruhe4", full_name: "inovexAcademy/Karlsruhe4",…}
$('#demo').select2({
width: "600px",
ajax: {
url: "https://api.github.com/search/repositories",
dataType: 'json',
delay: 250,
data: function (params) {
return {
q: params.term, // search term
page: params.page