This file contains hidden or 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 | |
f="$(dirname $0)/log.txt" | |
if [ "$1" = "time" ]; then | |
last="$(cat "$f" | grep "# " | tail -n 1 | sed 's/^.*: //' | cut -d '-' -f 1)" | |
last=$(date +%s -d "$last") | |
now=$(date +%s) | |
diff=$(($now - $last)) |
This file contains hidden or 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 | |
######################################################### | |
## Uses mformat to format text, then feed it to pandoc ## | |
## to create a pdf. Displays the pdf with zathura if ## | |
## no output file is specified. ## | |
######################################################### | |
TMP=$(mktemp /tmp/mrender.XXXXXXXX.pdf) | |
DIR=$(pwd) |
This file contains hidden or 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 | |
list="" | |
lsd() { | |
if echo "$list" | grep -F "$1" >/dev/null; then | |
return | |
fi | |
list=$(printf "%s\n%s" "$list" "$1") | |
echo "$1" |
This file contains hidden or 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 wmi | |
import time | |
import phue | |
import os | |
hot = 70 # Celsius | |
cold = 60 # Celsius | |
timeout = 10 | |
ip = "10.0.101.23" |
This file contains hidden or 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
#include <stdlib.h> | |
/* | |
* Defer an expression. | |
* This requires a block in an outer scope to have called defer_init, | |
* and the deferred statements will run once defer_run is called. | |
*/ | |
#define defer(expr) \ | |
do { \ | |
__label__ _defer_label; \ |
This file contains hidden or 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
#include "vector.h" | |
#include <stdio.h> | |
#include <snow/snow.h> | |
// Example program which will just put all strings in argv into a vector, | |
// then loop through and print the arguments | |
snow_main(int argc, char **argv) { | |
vector vec; | |
vector_init(&vec, sizeof(char *)); |
This file contains hidden or 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
#!/usr/bin/env python3 | |
################### | |
# <Configuration> # | |
################### | |
# Run 'command' while the temperature is less than 'maxTemp'. | |
maxTemp = 80 # Celsius | |
# When the temperature reached 'maxTemp', wait until it reaches 'minTemp' |
This file contains hidden or 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 | |
# Usage: remotedotool.sh [debug] | |
# | |
# Enter shell: Ctrl+Y | |
# All shell commands will be interpreted by your $SHELL, except for: | |
# * exit, x: Exit the remotedotool process | |
# * debug: Enable debug mode | |
# * nodebug: Disable debug mode | |
# |
This file contains hidden or 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
let fs = require("fs"); | |
let graphviz = require("graphviz"); | |
let graph = graphviz.digraph("G"); | |
let colors = [ | |
"aliceblue", "antiquewhite", "antiquewhite1", "antiquewhite2", | |
"antiquewhite4", "aquamarine", "aquamarine1", "aquamarine2", | |
"aquamarine4", "azure", "azure1", "azure2", | |
"azure4", "beige", "bisque", "bisque1", |
This file contains hidden or 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
#include "snow.h" | |
int (*mock_vector_free)(vector *vec); | |
int (*mock_vector_init)(vector *vec); | |
int vector_free(vector *vec) { | |
return mock_vector_free(vec); | |
} | |
int vector_init(vector *vec) { | |
return mock_vector_inti(vec); |