Skip to content

Instantly share code, notes, and snippets.

View tomedme's full-sized avatar

Tom Edme tomedme

  • France
View GitHub Profile
@tomedme
tomedme / git-auto-sign-commits.sh
Created July 8, 2019 05:38 — forked from mort3za/git-auto-sign-commits.sh
Auto sign your git commits
# Generate a new pgp key: (better to use gpg2 instead of gpg in all below commands)
gpg --gen-key
# maybe you need some random work in your OS to generate a key. so run this command: `find ./* /home/username -type d | xargs grep some_random_string > /dev/null`
# check current keys:
gpg --list-secret-keys --keyid-format LONG
# See your gpg public key:
gpg --armor --export YOUR_KEY_ID
# YOUR_KEY_ID is the hash in front of `sec` in previous command. (for example sec 4096R/234FAA343232333 => key id is: 234FAA343232333)
mysql -B -D prc_v2 -e 'select * from doctor where s_id in ( [] );' > _misc/doctors-pre-clean.tsv
mysql -B -D prc_v2 -e 'SELECT d_id, doctor.name, s_id, surgery.name,
(SELECT COUNT(p_id) FROM patient WHERE patient.d_id = doctor.d_id) AS num_patients
FROM prc_v2.doctor LEFT JOIN surgery ON doctor.s_id = surgery.id
ORDER BY s_id ASC , doctor.name ASC;' > _misc/doctors-post-clean.tsv
<?php
// http://overpass-api.de/api/map?bbox=8.2102,47.2750,8.8570,47.5274
// php render.php 8.2102,47.2750,8.8570,47.5274
// $xtile = floor((($lon + 180) / 360) * pow(2, $zoom));
// $ytile = floor((1 - log(tan(deg2rad($lat)) + 1 / cos(deg2rad($lat))) / pi()) / 2 * pow(2, $zoom));
define('METATILE', 8);
<?php
$apiKey = 'blah....blah';
$headers = array();
$headers[] = 'Content-Type: text/xml; charset=utf-8';
$headers[] = 'User-Agent: PEAR::XML_RPC2/@package_version@'; // after "User-Agent: " anything is ok, just not empty or missing
$params = array($apiKey);
<?php
$url = '...';
$client = new \SoapClient($url, array());
if (!$client instanceof \SoapClient)
throw new Exception("Unable to get SOAP client");
<?xml version="1.0" encoding="UTF-8" ?>
<Root PresetName="Ultimate Joystick">
<KeyboardLayout>en-GB</KeyboardLayout>
<MouseXMode Value="" />
<MouseXDecay Value="0" />
<MouseYMode Value="" />
<MouseYDecay Value="0" />
<MouseReset>
<Primary Device="{NoDevice}" Key="" />
<Secondary Device="{NoDevice}" Key="" />
<?xml version="1.0" encoding="UTF-8" ?>
<Root PresetName="Ultimate Keyboard Mouse">
<KeyboardLayout>en-GB</KeyboardLayout>
<MouseXMode Value="Bindings_MouseRoll" />
<MouseXDecay Value="0" />
<MouseYMode Value="Bindings_MousePitch" />
<MouseYDecay Value="0" />
<MouseReset>
<Primary Device="{NoDevice}" Key="" />
<Secondary Device="{NoDevice}" Key="" />
@tomedme
tomedme / gist:3075033
Created July 9, 2012 08:20
ST2 Ubuntu 12.04
tar xf Sublime\ Text\ 2\ Build\ 2181\ x64.tar.bz2
mv Sublime\ Text\ 2 sublime-text-2
sudo mv sublime-text-2 /usr/local/lib/
sudo ln -s /usr/local/lib/sublime-text-2 /usr/bin/sublime
sudo sublime /usr/share/applications/sublime.desktop
[Desktop Entry]
Version=1.0
Name=Sublime Text 2
GenericName=Text Editor
@tomedme
tomedme / carousel.html
Created April 27, 2012 09:46
jquery.pod1.fade.js html
@tomedme
tomedme / jquery.pod1.fade.js
Created April 18, 2012 01:50
jquery.pod1.fade.js
// $Id: jquery.pod1.fade.js 1206 2011-01-14 09:00:53Z tedme $
/**
* Pod1Fade
* Tom Edme & Hannah Stothard
* Nov 2010.
*/
(function ($) {