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 Create2DArray(rows, columns) { | |
var arr = []; | |
for (var i = 0; i < rows; i++) { | |
var col = []; | |
for (var j = 0; j < columns; j++){ | |
col[j] = 0; | |
} | |
arr[i] = col; | |
} | |
return arr; |
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 calcVH () { | |
var vH = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); | |
document.querySelector('body').setAttribute("style", "height:" + vH + "px;"); | |
} | |
window.onload = calcVH(); | |
window.addEventListener('onorientationchange', calcVH, true); | |
window.addEventListener('resize', calcVH, true); |
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
const request = require('request'); | |
// Request Header | |
var headers = { | |
'User-Agent': 'Secret Agent/0.0.1', | |
'Content-Type': 'application/x-www-form-urlencoded' | |
} | |
// Liste der comments | |
const comments = [ |
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
// append the current year to all elements with the '.currYear' class | |
document.querySelectorAll('.currYear').forEach(node => node.textContent += (new Date()).getFullYear()) |
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
// JSON Objekt mit text Attribut | |
let data = { | |
text: "lorem ipsum" | |
} | |
// gibt den Text zurück | |
module.exports.getText = () => data.text; | |
// setzt den Text | |
module.exports.setText = newText => data.text = newText; |
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
fetch('/api/open', { | |
method: "POST", | |
body: JSON.stringify({ | |
token: idToken | |
}), | |
headers: { | |
"Content-Type": "application/json" | |
} | |
}) |
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 | |
env XDG_CURRENT_DESKTOP=GNOME gnome-control-center |
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
import subprocess, time, os | |
// Startet vlc im Vollbild ohne Interface und in Dauerschleife | |
command = ['cvlc', '-f', '-L', '--no-video-title-show', '/home/malte/Videos'] | |
// Gibt das Display vor, auf dem das VLC-Fenster geöffnet wird, an | |
environment = dict(os.environ, DISPLAY=":0") | |
// Startet den VLC Prozess | |
vlc = subprocess.Popen(command, env=environment) |
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 | |
upSeconds="$(/usr/bin/cut -d. -f1 /proc/uptime)" | |
secs=$((${upSeconds}%60)) | |
mins=$((${upSeconds}/60%60)) | |
hours=$((${upSeconds}/3600%24)) | |
days=$((${upSeconds}/86400)) | |
UPTIME=`printf "%dd %02dh %02dm %02ds" "$days" "$hours" "$mins" "$secs"` | |
# get the load averages |
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 | |
ip addr >> $(hostname).txt | |
scp $(hostname).txt malts.me:~/ips | |
rm $(hostname).txt |
OlderNewer