Discover gists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TIME_DURATION_UNITS = ( | |
('week', 60*60*24*7), | |
('day', 60*60*24), | |
('hour', 60*60), | |
('min', 60), | |
('sec', 1) | |
) | |
def human_time_duration(seconds): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def compute_reconstruction_statistics(reference_model_path): | |
# Images w. intrinsics and extrinsics. | |
with open(os.path.join(reference_model_path, 'cameras.txt'), 'r') as f: | |
raw_cameras = f.readlines()[3 :] | |
cameras = {} | |
for raw_line in raw_cameras: | |
split_line = raw_line.strip('\n').split(' ') | |
cameras[int(split_line[0])] = split_line[1 :] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ObjectId } from 'mongodb'; | |
/* Use this to extend any interface with an `_id` property of type OID */ | |
export type TWithOid<T extends {}> = T & { | |
_id: ObjectId; | |
}; | |
/** | |
* Replaces a string property with the same property of type ObjectId. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Always enforce preferences on the `qvm.prefs` module: many times I see | |
`label` only in `qvm.present`, which is only run on creation of the | |
qube, not when it already exists. The `qvm.prefs` module is checked | |
everytime even if the qube already exists. I think label should be | |
enforced not let for the user to modify and then later the state | |
ignore the label change, but of course I don't know your internal | |
policy about this matter and I might be wrong depending on it. | |
- Do not specify literal names as the `source` value of `qvm.clone`, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aahed | |
aalii | |
aapas | |
aargh | |
aarti | |
abaca | |
abaci | |
aback | |
abacs | |
abaft |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
import 'dart:io'; | |
import 'package:file_picker/file_picker.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:webview_flutter/webview_flutter.dart'; | |
// #docregion platform_imports | |
// Import for Android features. | |
// import 'package:webview_flutter_android/webview_flutter_android.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import typing | |
import math | |
from uuid import UUID | |
from pyasn1.codec.der import decoder | |
from pyasn1_modules import rfc5652 | |
from struct import unpack | |
from cryptography import utils | |
from cryptography.exceptions import AlreadyFinalized, InvalidKey | |
from cryptography.hazmat.primitives.kdf import KeyDerivationFunction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
"1185030898148724777", | |
"956131521733984287", | |
"956097947727179806", | |
"1185045871478448242", | |
"932096380879667253", | |
"956246550152118374", | |
"928549000431407164", | |
"976786710836944936", | |
"956128945227567145", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script will backup your Coolify instance and move everything to a new server. Docker volumes, Coolify database, and ssh keys | |
# 1. Script must run on the source server | |
# 2. Have all the containers running that you want to migrate | |
# Configuration - Modify as needed | |
sshKeyPath="$HOME/.ssh/your_private_key" # Key to destination server | |
destinationHost="server.example.com" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Will split a png cubemap/skymap image produced by blender into 6 separated image files for use in a skybox within unity | |
# Requires Python Imaging Library > http://www.pythonware.com/products/pil/ | |
# The author takes no responsibility for any damage this script might cause, | |
# feel free to use, change and or share this script. | |
# 2013-07, CanOfColliders, m@canofcolliders.com | |
from PIL import Image |
NewerOlder