Skip to content

Instantly share code, notes, and snippets.


Luckydonald luckydonald

Block or report user

Report or block luckydonald

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
luckydonald / gist:cfde4c8107da30390b17ddc35b964f4a
Created Jun 11, 2019 — forked from nerones/gist:6778719
An easy way to log session data and queries with Monolog and Hooks in codeigniter. Some of the code is taken from Profiler class in the core of CI. The hook must be post_controller or post_system
View gist:cfde4c8107da30390b17ddc35b964f4a
class LoggerHook
private $CI;
function __construct()
$this->CI =& get_instance();
public function log()
def num(n):
string = ["", "", ""]
for d in str(int(n)):
for i, l in enumerate(digit(int(d)).split("\n")):
string[i] += l
# end for
# end for
return "\n".join(string)
# end def
luckydonald / function.cast.php
Created Jul 23, 2018 — forked from borzilleri/function.cast.php
PHP function to cast an object from one class to another.
View function.cast.php
* Cast an object into a different class.
* Currently this only supports casting DOWN the inheritance chain,
* that is, an object may only be cast into a class if that class
* is a descendant of the object's current class.
* This is mostly to avoid potentially losing data by casting across
* incompatable classes.
View iOS_11_webapp_statusbar_issues__index.html
<meta charset="utf-8" />
<meta name="apple-mobile-web-app-title" content="something" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, height=device-height">
View diff.patch
[35%]tstrazzere@bebop:[rsakeyfind] $ diff rsakeyfind.cpp-fixed rsakeyfind/rsakeyfind.cpp-original
colordiff 1.0.10 (
(C)2002-2012 Dave Ewart,
< #include <unistd.h>
> #include <fcntl.h>
View check_authorization.php
define('BOT_TOKEN', 'XXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXX'); // place bot token of your bot here
function checkTelegramAuthorization($auth_data) {
$check_hash = $auth_data['hash'];
$data_check_arr = [];
foreach ($auth_data as $key => $value) {
$data_check_arr[] = $key . '=' . $value;
luckydonald /
Last active Feb 17, 2018
How to get the hostnames and informations of other hosts in the same docker scale grouping.

The way I could do it was by using the docker api. I used the docker-py package to access it.

The api exposes a labels dictionary for each container, and the keys com.docker.compose.container-number, com.docker.compose.project and com.docker.compose.service did what was needed to build the hostname.

The code below is a simplified for code I am now using. You can find my advanced code with caching and fancy stuff that at Github at luckydonald/pbft/dockerus.ServiceInfos (backup at

luckydonald /
Last active Apr 2, 2018
A script to scale images to a monitor resulution and add the best fitting background color
Makes border aware sizing of desktop wallpapers.
You need to install:
$ pip install Pillow easygui joblib
import glob
import os
View utf8_javascript_decode # # #
luckydonald / Api
Last active Apr 20, 2016 — forked from anonymous/Api urls
json api of several pages I encountered.
View Api
You can’t perform that action at this time.