Skip to content

Instantly share code, notes, and snippets.

294 people are currently looking at this profile

Luckydonald luckydonald

294 people are currently looking at this profile
  • Some basement in Equestria.
View GitHub Profile
luckydonald / Fallout 4 Save File
Created Apr 18, 2021 — forked from SirTony/Fallout 4 Save File
The binary format for Fallout 4 PC save files.
View Fallout 4 Save File

Fallout 4 Save File Format

The binary format for Fallout 4 PC save files. This document was created by reverse-engineering files from version of the game.

Note: This document is incomplete!

Table of Contents

View gist:a53178b2ee66dddf655143823e189d20
extern crate hyper;
extern crate url;
static HOST: &'static str = "";
macro_rules! ret_err(
($e:expr) => {{
match $e {
Ok(v) => v,
Err(e) => { println!("Line {}: {}", line!(), e); return; }
luckydonald / python_like_exception.php
Last active Mar 23, 2020
python style exception trace for PHP
View python_like_exception.php
static function python_like_exception(
Throwable $e, bool $skip_seen = true, ?array $seen = null
): string {
if ($skip_seen && !$seen) {
$seen = array();
$prev = $e->getPrevious();
if ($prev) {
$result[] = self::python_like_exception($prev, $skip_seen, $seen);
$result[] = "\nDuring handling of the above exception, another exception occurred:\n";
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 Oct 24, 2020
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