Skip to content

Instantly share code, notes, and snippets.

SeeSchloß seeschloss

View GitHub Profile
View post.php
<?php
$users = json_decode(file_get_contents(__DIR__."/users.cfg"), true);
if (isset($_REQUEST['user']) and isset($_REQUEST['token'])) {
$user = $_REQUEST['user'];
$token = $_REQUEST['token'];
if (!isset($users[$user])) {
http_response_code(404);
@seeschloss
seeschloss / README.md
Created Jan 27, 2016 — forked from mbostock/.block
Van der Grinten IV
View README.md
View letsencrypt.sh
#!/bin/bash
DOMAINS="example.com www.example.com example.fr"
EMAIL="admin@example.com"
SCRIPT=$(realpath "$0")
DIR=$(dirname "$SCRIPT")
CERTS="$DIR/certs"
WWW="$DIR/www"
View deeplop.sh
#!/bin/bash
PYBORG="/home/seeschloss/bin/deeborg --file=/home/seeschloss/deeplop-dlfp.db"
COOKIE="linuxfr.org_session="
DEBUG=0
BOTNAME="deeplop"
STATEFILE="$HOME/.deeplop.state"
View sql.sh
#!/usr/bin/env bash
FILE="$(mktemp)"
trap "rm $FILE; exit" EXIT
DEBUG=0
if test "$1" = "-d"; then
DEBUG=1
shift 1
fi
View README.md

Zoomable Sunburst with Labels

View serialization_sql_dump_cleaner.sh
#!/bin/bash
##################################################################
# Licensed under GNU GPL v3 #
# regis.leroy@gmail.com #
# #
# DNS replacement scrpit in SQL dumps containing (also) PHP #
# serialized strings. #
# This script use bash and perl' perl is used to increment #
# serialized string length while performing DNS replacement #
# It also use sed for other basic DNS replacements #
View hexagons.js
(function(){
var canvas = document.getElementById('hexmap');
var hexHeight,
hexRadius,
hexRectangleHeight,
hexRectangleWidth,
hexagonAngle = 0.523598776, // 30 degrees in radians
sideLength = 10,
boardWidth = 100,
View gist:5412485
MySQL [plop]> create table test (str varchar(255), str2 text);
Query OK, 0 rows affected (0.18 sec)
MySQL [plop]> insert into test (str, str2) values ('plop', 'plop2');
Query OK, 1 row affected (0.00 sec)
MySQL [plop]> select * from test;
+------+-------+
| str | str2 |
+------+-------+
View gist:5387979
<?php
$object = new stdClass();
$object->{'property'} = 'value 1';
$object->{'42'} = 'value 2';
$array = (array)$object;
var_dump($array);
You can’t perform that action at this time.