Skip to content

Instantly share code, notes, and snippets.

Verify Github on Galxe. gid:7HBj7YodkQBjvUWF89Kiuc
@Celeborn2BeAlive
Celeborn2BeAlive / .deps...github...OpenZeppelin...openzeppelin-contracts...contracts...utils...math...SafeMath.sol
Created January 25, 2022 07:59
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=builtin&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
@Celeborn2BeAlive
Celeborn2BeAlive / gist:bd6bd165b84080eeb4ec22ff3ecbafd3
Created December 3, 2020 16:38
Copy Markdown Link Bookmarklet (only works for https)
javascript:(function(){s=`[${document.querySelector("title").innerHTML}](${window.location})`;elt=document.querySelector(".ytp-time-duration");if(elt){s=`${s} ⏳ ${elt.innerHTML}`;}navigator.clipboard.writeText(s).then(()=>{alert(s)});})()
[tool.poetry]
name = "test_project"
version = "0.1.0"
description = ""
authors = ["Laurent 'c2ba' NOËL"]
license = "MIT"
[tool.poetry.dependencies]
python = "3.8.5"
@Celeborn2BeAlive
Celeborn2BeAlive / README.md
Created September 16, 2020 21:47 — forked from Hopobcn/README.md
gitlab-runner configuration file with docker runner for using NVIDIA GPUs (nvidia-docker)

Use Gitlab-CI with GPU support

Since gitlab-runner cannot be forced to use nvidia-docker wrapper, follow this steps:

  1. Install all required software: docker, nvidia-docker, gitlab-ci-multi-runner
  2. Execute: curl -s http://localhost:3476/docker/cli
  3. Use that data to fill devices/volumes/volume_driver fields in /etc/gitlab-runner/config.toml
@Celeborn2BeAlive
Celeborn2BeAlive / Local PR test and merge.md
Created September 15, 2020 13:48 — forked from adam-p/Local PR test and merge.md
Testing a pull request, then merging locally; and avoiding TOCTOU

It's not immediately obvious how to pull down the code for a PR and test it locally. But it's pretty easy. (This assumes you have a remote for the main repo named upstream.)

Getting the PR code

  1. Make note of the PR number. For example, Rod's latest is PR #37: Psiphon-Labs/psiphon-tunnel-core#37

  2. Fetch the PR's pseudo-branch (or bookmark or rev pointer whatever the word is), and give it a local branch name. Here we'll name it pr37:

$ git fetch upstream pull/37/head:pr37
@Celeborn2BeAlive
Celeborn2BeAlive / install-package.sh
Created September 12, 2020 23:57 — forked from pgilad/install-package.sh
Install a pip package using Poetry and use pre-release version
# An example on how to install poetry preview version
$ pipx install poetry --pip-args="--pre"
@Celeborn2BeAlive
Celeborn2BeAlive / log_exec.py
Created September 8, 2020 16:17 — forked from mckaydavis/log_exec.py
Python non-blocking reading from stdout and stderr of subprocess.popen process using os.pipe and select.select
#!/usr/bin/env python
# File: log_exec.py
# Author: McKay Davis
# Date: Jun 23, 2014
# Non-blocking stdout and stderr read from a
# Popen process
import os
import subprocess
[tool.poetry]
name = "c2ba_hypermodern_python"
version = "0.1.0"
description = "Project built by going through Hypermodern Python tutorial"
homepage = "https://gitlab.com/c2ba_sandbox/sandbox_python/hypermodern_python"
repository = "https://gitlab.com/c2ba_sandbox/sandbox_python/"
authors = ["Celeborn2BeAlive <laurent.noel.c2ba@gmail.com>"]
keywords = ["hypermodern", "python", "tutorial"]
[tool.poetry.dependencies]
@Celeborn2BeAlive
Celeborn2BeAlive / build_otio_wheel.sh
Created May 20, 2020 17:39
Shell script to build a wheel of OpenTimelineIO 0.12.1
#!/bin/bash
# This script generate a wheel for OpenTimelineIO in dist folder
# We need it has a patch to install otio 0.12.1 in Windows Blender because it requires compilation
# This wheel should be distributed with code that depends on otio 0.12.1 and installed using Blender's python -m pip
# You need python (3.7.*) and Visual Studio 2017+
CURRENT_DIR=`dirname $0`
ROOT_DIR=$CURRENT_DIR/