Skip to content

Instantly share code, notes, and snippets.

Avatar
🙃

Andreas Gohr splitbrain

🙃
View GitHub Profile
@splitbrain
splitbrain / azure-ad-b2c-jwt-rsa.php
Created Apr 15, 2019
example how to convert Azure AD B2C key info to PEM format
View azure-ad-b2c-jwt-rsa.php
<?php
// composer require phpseclib/phpseclib
require_once('vendor/autoload.php');
$tenant = 'cosmocode';
$policy = 'b2c_1_signupandsignin';
@splitbrain
splitbrain / action.php
Created May 27, 2016
log js and non js accesses
View action.php
<?php
/**
* DokuWiki Plugin jscheck (Action Component)
*
* @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
* @author Andreas Gohr <andi@splitbrain.org>
*/
// must be run within Dokuwiki
if(!defined('DOKU_INC')) die();
@splitbrain
splitbrain / fixer.php
Created Jan 24, 2016
DokuWiki CLI script I used to automatically create pull requests for all DokuWiki plugins available on github that had wrong method signatures
View fixer.php
#!/usr/bin/php
<?php
if(!defined('DOKU_INC')) define('DOKU_INC', realpath(dirname(__FILE__) . '/../') . '/');
define('NOSESSION', 1);
require_once(DOKU_INC . 'inc/init.php');
class FixerCLI extends DokuCLI {
protected $dir;
@splitbrain
splitbrain / ios2and.php
Created Jun 4, 2015
iOS image assets to Andorid DIP buckets
View ios2and.php
#!/usr/bin/php
<?php
/**
* Very simple script to convert iOS xcode imageset directories to DIP buckets
* for Android development
*/
if(!isset($argv[2])) {
die("Usage: ios2and.php <ios image asset folder> <android res folder>\n");
}
View TSL45315.py
import smbus
from time import sleep
# select the correct i2c bus for this revision of Raspberry Pi
revision = ([l[12:-1] for l in open('/proc/cpuinfo','r').readlines() if l[:8]=="Revision"]+['0000'])[0]
bus = smbus.SMBus(1 if int(revision, 16) >= 4 else 0)
class TSL45315:
VAL_COMMAND = 0x80
REG_CONTROL = 0x00 | VAL_COMMAND
@splitbrain
splitbrain / versionfix.php
Last active Mar 10, 2017
Check and fix versions for DokuWiki plugins
View versionfix.php
#!/usr/bin/php
<?php
echo 'please use https://github.com/splitbrain/dokuwiki-versionfix now';
View keybase.md

Keybase proof

I hereby claim:

  • I am splitbrain on github.
  • I am splitbrain (https://keybase.io/splitbrain) on keybase.
  • I have a public key whose fingerprint is 6AAD B781 05DD F7AB 7627 E73B 8EAD 3A2A 7700 A618

To claim this, I am signing this object:

View apps.php
#! /usr/bin/php
<?php
class AndroidApp {
#0: Trees for Cars by Leo Grand
#1: 0,99 $
#2: December 11, 2013
#3: Complete
#4: Android Apps
#5: Transportation
View changes
diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h
index a935bde..3ca167c 100644
--- a/Marlin/Configuration.h
+++ b/Marlin/Configuration.h
@@ -8,13 +8,13 @@
// Huxley: http://reprap.org/wiki/RepRapPro_Huxley_maintenance
// Uncomment ONE of the next three lines - the one for your RepRap machine
-//#define REPRAPPRO_HUXLEY
-#define REPRAPPRO_MENDEL
@splitbrain
splitbrain / ickeinit.sh
Created Dec 3, 2012
initialises the ICKE wiki repositories
View ickeinit.sh
#!/bin/sh
#
# Usage: wget -qO- https://raw.github.com/gist/4195252/ickeinit.sh |sh -s <installdir>
DIR="$1"
if [ -z "$DIR" ]
then
echo "Please give install directory as first parameter."
exit
You can’t perform that action at this time.