Skip to content

Instantly share code, notes, and snippets.

Avatar

Anthony Zhang Uberi

View GitHub Profile
View load-xls.py
import shutil, subprocess, tempfile, os
import openpyxl
def load_workbook_xls(filename, **kwargs):
"""Same as openpyxl.load_workbook, but supports XLS files instead of XLSX files."""
soffice_path = shutil.which("soffice")
if soffice_path is None:
raise EnvironmentError("Can't find `soffice` executable - ensure Libreoffice Calc is installed correctly")
with tempfile.TemporaryDirectory() as temp_xlsx_directory:
View vertical-binary-search.py
import bisect
CHECKBOX_ENTRIES = [
(0, 0, 'One'),
(4, 0, 'Two'),
(8, 0, 'Three'),
(0, 10, 'Red'),
(4, 10, 'Green'),
(8, 10, 'Blue'),
(0, 20, 'A'),
View coordinate-system-conversion.py
POINTS_PER_CHARACTER = 72.23 / 13
def row_col_offset_to_xy_points(row, col, offset_x, offset_y, col_widths, row_heights):
pos_x = sum(col_widths[i] for i in range(col)) * POINTS_PER_CHARACTER + offset_x
pos_y = sum(row_heights[j] for j in range(row)) + offset_y
return (pos_x, pos_y)
@Uberi
Uberi / index.html
Last active Sep 15, 2018
Introduction to Web3 talk - sample dApp for setting/getting the value of a variable. https://hypotenuse.ca/intro-to-web3/
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/ethereum/web3.js/dist/web3.min.js"></script>
<script type="text/javascript" src="index.js"></script>
<title>Storage Smart Contract</title>
</head>
<body>
@Uberi
Uberi / storage.sol
Created Sep 14, 2018
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=soljson-v0.4.25+commit.59dbf8f1.js&optimize=true&gist=
View storage.sol
pragma solidity ^0.4.0;
contract Storage {
uint value;
function set(uint newValue) public {
value = newValue;
}
function get() public view returns (uint) {
View keybase.md

Keybase proof

I hereby claim:

  • I am uberi on github.
  • I am uberi (https://keybase.io/uberi) on keybase.
  • I have a public key whose fingerprint is C927 DE93 02A1 1966 1F00 8726 84D3 1436 5F56 B350

To claim this, I am signing this object:

View windows-build-distribution.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View crash-rate-aggregates-watchdog.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View non-experiment-slow-script-analysis.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View telemetry-tools-bugfix-testing.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.