Skip to content

Instantly share code, notes, and snippets.

import hashlib
import hmac
from flask import Flask
from flask import request, url_for
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def hello_world():
KEY = "" # REPLACE WITH YOUR HUB SECRET VALUE
@thewheat
thewheat / league_fixture.php
Created October 3, 2013 12:31
Support for custom number of fixtures. Caveat: disables checking of proper number of fixtures for all leagues. Should work with https://github.com/thewheat/PHPLeague-for-WP/commit/0c47e97739d24a9b5e7b065b4ae85bf72ce6a24a Add to your existing files Lines ending with "// added for custom number of fixtures" Lines between "// new code - 1" and "// …
// new code - 1
if (isset($_POST['fixtures_add']) && check_admin_referer('phpleague'))
{
$nb_fixtures = $db->nb_fixtures_league($id_league);
$db->add_fixtures_league($nb_fixtures+1, $id_league);
}
if (isset($_POST['fixtures_delete']) && check_admin_referer('phpleague'))
{
$nb_fixtures = $db->nb_fixtures_league($id_league);
$db->remove_fixtures_league($id_league, $nb_fixtures);
@thewheat
thewheat / districts.geojson
Last active March 27, 2016 07:42
Data extracted from the Survey Department http://survey.gov.bn/web/survey_department/map as part of Brunei Geek Meet's Data Hackathon http://www.meetup.com/BruneiGeekMeet/events/229707511/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thewheat
thewheat / brunei_districts.geojson
Created March 27, 2016 07:45
Data extracted from the Brunei's Survey Department http://survey.gov.bn/web/survey_department/map as part of Brunei Geek Meet's Data Hackathon http://www.meetup.com/BruneiGeekMeet/events/229707511/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thewheat
thewheat / map 22.geojson
Created April 9, 2016 06:37
22 BSB -> Rimba/ITB/UBD/JIS -> BSB: Tamu Gadong - UNISSA - J. Tungku - Rimba - ITB - UBD - JIS
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Asmera
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
@thewheat
thewheat / bookmarklet-raw.js
Created June 11, 2016 10:36
Show number of online records in Intercom. Use http://mrcoles.com/bookmarklet/ to convert raw JS to bookmarklet
/* raw JS file -1 */
var num_online = $(".avatar__activity-indicator.o__on").length;
var users_displayed = $(".ember-view.tbl__user-list-row").length;
var msg = num_online + " online" + (num_online == users_displayed ? " but there could be more, scroll down to load more records":"");
/* alert(msg); */
var className = "bookmarklet_message";
var element = $("." + className);
@thewheat
thewheat / map 21.geojson
Last active July 2, 2016 03:29
Bus Route 21. Based on Bus Route Overview and not actual signage. Likely lots of mistakes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thewheat
thewheat / map 34.geojson
Last active July 2, 2016 03:47
Bus Route 34. Based on Bus Route Overview and not actual signage. Likely lots of mistakes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thewheat
thewheat / map 35.geojson
Last active July 2, 2016 04:10
Bus Route 35. Based on Bus Route Overview and not actual signage. Likely lots of mistakes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.