Skip to content

Instantly share code, notes, and snippets.

View whazor's full-sized avatar

Nanne whazor

  • 10:36 (UTC +02:00)
View GitHub Profile
@whazor
whazor / gist:1555118
Created January 3, 2012 14:36
Filelock
<?php
$file = dirname( __FILE__ ).'/lock.txt';
$lock = file_exists($file);
if($lock) $lock = file_get_contents($file);
if($lock && $lock != 'unlocked' && ((time() - $lock) < 120))
die('Het scriptje is al bezig! Wacht '.(120 - (time() - $lock)).'s.');
else file_put_contents($file, time());
echo 'ZWARE OPERATIE';
@whazor
whazor / index.html
Created January 5, 2012 22:44
MySQL user generator
<!doctype html>
<html>
<head>
<title>mySQL user generator</title>
<style>
body, html {
background-color: #E3E3E3;
font: normal normal normal 1em Arial, sans-serif;
}
label {
@whazor
whazor / scala.rb
Last active December 10, 2015 07:48
forked and updated to RC5
# to install the latest stable version:
brew install scala --with-docs
# to install scala-2.10.0-RC5:
brew install https://raw.github.com/gist/4403133/scala.rb --with-docs
# to switch versions (from https://github.com/mxcl/homebrew/wiki/External-Commands):
brew switch scala 2.9.2
brew switch scala 2.10.0-RC5
ewrwerwreewr
047ee02e348d35995b5a85cb1eea393117ba447cc8755bd61e5e680c0bd1a07ad7cde18e2adee5cb9bd7e4da640d83f833b766aac5a6e3d08c8dd450ad372328ae;Roconda
DO $$
<<outer_block>>
declare
left_rating int;
left_player varchar(100);
left_scoring int;
right_rating int;
right_player varchar(100);
right_scoring int;
begin
WITH RECURSIVE p(current_game_number) AS
(WITH players AS (SELECT DISTINCT player_name FROM players)
SELECT (select min(id) from plays) AS game_number, player_name, 1000.0 AS elo
FROM players
UNION ALL
(WITH previous_elos AS (SELECT * FROM p)
SELECT plays.id,
player_name,
CASE
#!/usr/bin/env bash
KEYCLOAK_URL="http://localhost:8080"
KEYCLOAK_USER="admin"
KEYCLOAK_PASSWORD="admin"
KEYCLOAK_CLIENT_ID="terraform"
# KEYCLOAK_CLIENT_SECRET="884e0f95-0f42-4a63-9b1f-94274655669e"
echo "Logging into keycloak admin"

Keybase proof

I hereby claim:

  • I am whazor on github.
  • I am whazor (https://keybase.io/whazor) on keybase.
  • I have a public key ASBy7u_Cmq1Lsgh4qhEja9v_LNS2CEIkZxs7us6Pl7B-uAo

To claim this, I am signing this object: