Skip to content

Instantly share code, notes, and snippets.

View obstschale's full-sized avatar
🥑
Avocado for the wise.

Hans-Helge Buerger obstschale

🥑
Avocado for the wise.
View GitHub Profile
@obstschale
obstschale / octave.md
Last active December 26, 2023 04:58
An Octave introduction cheat sheet.
@obstschale
obstschale / print-binary-tree.c
Created June 22, 2012 08:56
Print a binary tree
void padding ( char ch, int n ){
int i;
for ( i = 0; i < n; i++ )
putchar ( ch );
}
void structure ( struct node *root, int level ){
int i;
@obstschale
obstschale / watson.1m.sh
Created January 20, 2022 13:16
xbar script for watson
#!/bin/bash
# Watson Status
#
# by Antoine Corcy <contact@sbin.dk>
#
# <xbar.title>Watson Status</xbar.title>
# <xbar.version>1.0</xbar.version>
# <xbar.author>Antoine Corcy</xbar.author>
# <xbar.author.github>toin0u</xbar.author.github>
@obstschale
obstschale / autostart
Last active December 21, 2020 18:36
Raspberry Pi Script to autostart Chromium
# /home/pi/.config/lxsession/LXDE-pi/autostart before Buster
# /etc/xdg/lxsession/LXDE-pi/autostart on Buster
@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@xscreensaver -no-splash
@point-rpi
@sh /home/pi/bin/start-chromium.sh
@obstschale
obstschale / binarySearchTree-searching_r.c
Created July 11, 2012 06:23
Searching a Binary Sequence Search Tree (recursive)
int search(Treepointer T, char target[ ])‏
{
if (T == NULL)‏
return 0; // not found
else
if (strcmp(target, T -> data) == 0)‏
return 1; // found
else
if (strcmp(target, T -> data) < 0)‏
return search(T -> left, target); // go left
@obstschale
obstschale / boyermoorematch.c
Created July 6, 2012 13:06
Boyer-Moore Algorithm
int boyermoorematch(char S[ ], char P[ ])‏
{
int n, m, i, j, lastch; n = strlen(S); m = strlen(P);
i = m1; j = m1;
while (i < n) // not end of string S
if (P[j] == S[i])
if (j == 0) // first char of pattern
return i;
else
{
cecho() {
local code="\033["
case "$1" in
black | bk) color="${code}0;30m";;
red | r) color="${code}1;31m";;
green | g) color="${code}1;32m";;
yellow | y) color="${code}1;33m";;
blue | b) color="${code}1;34m";;
purple | p) color="${code}1;35m";;
cyan | c) color="${code}1;36m";;
@obstschale
obstschale / press.sh
Last active July 19, 2017 15:13
Bash script for setting up a new WordPress site (Laravel Valet runs in the background)
#!/bin/bash
# =========================================
# Create new WordPress Site with 1 command
#
# press <name> <dbname>
#
# name: name of the folder, website, url
# dbname: database name, which will be created and used by WordPress
#
@obstschale
obstschale / prim.c
Created June 22, 2012 16:29
Prim's Algorithm
void prim (int weight[ ][SIZE])‏
{
int i, j, k, min, lowWeight[SIZE], closest[SIZE];
for (i = 1; i < SIZE; ++i)
{ // initialise lowWeight to weights from vertex 0
lowWeight[i] = weight[0][i]; closest[i] = 0; // vertex 0 is closest
}
for (i = 1; i < SIZE; ++i)
{ // find nearest adjacent vertex to the tree
k = 1; min = lowWeight[1];
@obstschale
obstschale / lock-plugins.php
Last active August 30, 2016 13:54 — forked from daggerhart/lock-plugins.php
Simple plugin that prevents requests for updats for a given list of plugins.
<?php
/*
* Plugin Name: Lock plugin updates
* Description: Prevent plugin updates
* Version: 1.0.0
* Author: daggerhart
*/
add_filter( 'http_request_args', 'lock_plugins_http_request_args', 5, 2 );