Skip to content

Instantly share code, notes, and snippets.

View cxkoda's full-sized avatar
🔥

cxkoda cxkoda

🔥
View GitHub Profile
@cxkoda
cxkoda / bindings.json
Last active July 4, 2023 16:30
reviewable-key-bindings
[
[
"shift+1",
"Show/hide all comments",
"revealAllDiscussions()"
]
[
"f",
"Show next/latest diffs",
"setProposedDiffBounds()"
@cxkoda
cxkoda / keybase.md
Last active January 21, 2023 12:56

Keybase proof

I hereby claim:

  • I am cxkoda on github.
  • I am cxkoda (https://keybase.io/cxkoda) on keybase.
  • I have a public key ASDxcPtnhD4F30mDUznGOAgZtDx7no4qv3tIgf000HY-LAo

To claim this, I am signing this object:

@cxkoda
cxkoda / logid.cfg
Created September 28, 2022 20:38
master mx 3 settings
// Logiops (Linux driver) configuration for Logitech MX Master 3.
// Includes gestures, smartshift, DPI.
// Tested on logid v0.2.3 - GNOME 3.38.4 on Zorin OS 16 Pro
// What's working:
// 1. Window snapping using Gesture button (Thumb)
// 2. Forward Back Buttons
// 3. Top button (Ratchet-Free wheel)
// What's not working:
// 1. Thumb scroll (H-scroll)
// 2. Scroll button
@cxkoda
cxkoda / README.md
Last active April 20, 2022 12:40
Phony PRs to review entire codebase

Phony PRs to review entire codebase

This creates a new repository root (empty), clones all commits and rebases them to the new root (review). The diff between review and empty therefor includes the whole codebase as addition.

git switch --orphan empty
git commit --allow-empty -m 'empty'
git checkout main
git checkout -b review
@cxkoda
cxkoda / README.txt
Created February 22, 2022 09:05
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.8.7+commit.e28d00a7.js&optimize=true&runs=200&gist=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads for the very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS
@cxkoda
cxkoda / GetSet.sol
Created October 19, 2021 07:25
Solidity GetSet Test contract
// SPDX-License-Identifier: MIT
// Copyright 2021 David Huber (@cxkoda)
pragma solidity >=0.8.0 <0.9.0;
/**
* @notice Simple test contract.
* @dev Possesses an internal state that can be accessed and manipulated.
* @author David Huber (@cxkoda)
*/
@cxkoda
cxkoda / aanda.py
Last active September 7, 2020 08:05
Fetch the A&A submission status using python
import requests
from bs4 import BeautifulSoup
import argparse
def getData(author, article):
with requests.Session() as session:
# Fetch Data from server
payload = {
'codeauteur': author,
'refarticle': article,
@cxkoda
cxkoda / tasoc.py
Created August 27, 2020 13:35
TESS Asteroseismic Science Operations Center (TASOC) Python Login
import requests
from bs4 import BeautifulSoup
with requests.Session() as session:
# Get login token
response = session.get('https://tasoc.dk')
soup = BeautifulSoup(response.text, 'html.parser')
tokens = soup.find_all("input", {'name': 'token'})
@cxkoda
cxkoda / doi2ads
Created December 17, 2019 16:12
Generate ADS bibtex entries for papers with given dois
#!/usr/bin/env python3
import requests
import json
import tempfile
import sys, os
# generate an api token under https://ui.adsabs.harvard.edu/#user/settings/token
token = ""
@cxkoda
cxkoda / clang-format-stage
Created August 13, 2019 10:44
Clang-format all staged changes in a git repository
#!/bin/bash
blobs=$(mktemp)
git status --porcelain=v2 -uno > $blobs
while read _ _ _ _ _ filemode oldHash newHash filename; do
# Skip the file if the staged blob has not changed
if [ $oldHash == $newHash ]; then
continue