Skip to content

Instantly share code, notes, and snippets.

View mika4president's full-sized avatar

Michel Kapelle mika4president

  • Electronic Service Connected Systems
  • Zevenbergen, Noord-Brabant
  • X @Dutchwildlife
View GitHub Profile
@adijvlian
adijvlian / CalendarController.php
Created May 28, 2018 04:11
JQuery FullCalendar Integration with PHP and MySQL
<?php
class CalendarController extends ControllerBase
{
public function indexAction()
{
include "incld/load.php";
include "incld/insert.php";
include "incld/update.php";
include "incld/delete.php";
}
@subfuzion
subfuzion / curl.md
Last active May 3, 2024 09:26
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@ejoubaud
ejoubaud / simulate_keypress.js
Last active April 9, 2024 18:38
Simulate keypress that works in Google nav in Chrome
// Based on http://stackoverflow.com/a/10520017/1307721 and http://stackoverflow.com/a/16022728/1307721
Podium = {};
Podium.keydown = function(k) {
var oEvent = document.createEvent('KeyboardEvent');
// Chromium Hack
Object.defineProperty(oEvent, 'keyCode', {
get : function() {
@AGWA
AGWA / rpi-hdmi.sh
Last active March 18, 2024 06:04
Enable and disable the HDMI port on the Raspberry Pi: `rpi-hdmi on` to turn on, `rpi-hdmi off` to turn off. X is properly reinitialized when re-enabling.
#!/bin/sh
# Enable and disable HDMI output on the Raspberry Pi
is_off ()
{
tvservice -s | grep "TV is off" >/dev/null
}
case $1 in
@ksafranski
ksafranski / expecting.md
Last active November 11, 2023 23:00
Basic principles of using tcl-expect scripts

Intro

TCL-Expect scripts are an amazingly easy way to script out laborious tasks in the shell when you need to be interactive with the console. Think of them as a "macro" or way to programmaticly step through a process you would run by hand. They are similar to shell scripts but utilize the .tcl extension and a different #! call.

Setup Your Script

The first step, similar to writing a bash script, is to tell the script what it's executing under. For expect we use the following:

#!/usr/bin/expect
@hakre
hakre / README.md
Last active August 18, 2022 12:57
Iterators for PHP XMLReader for ease of parsing

Iterators for PHP XMLReader for Ease of Parsing

Change Log:

  • 0.1.12 maintenance release with fixes.

  • 0.1.11 maintenance release with fixes. added XMLReader::CDATA and XMLReader::WHITESPACE node support for XMLWritingIteration. added