Skip to content

Instantly share code, notes, and snippets.

View dhimmel's full-sized avatar
🎯
Focusing

Daniel Himmelstein dhimmel

🎯
Focusing
View GitHub Profile
@cthoyt
cthoyt / ground_odisea.ipynb
Last active May 5, 2022 13:45
Ground ODiseA
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yookoala
yookoala / 90-mac-superdrive.rules
Last active April 30, 2024 05:18
udev rules to use Apple SuperDrive on Linux
#
# Apple SuperDrive initialization rule
#
# See: https://gist.github.com/yookoala/818c1ff057e3d965980b7fd3bf8f77a6
ACTION=="add", ATTRS{idProduct}=="1500", ATTRS{idVendor}=="05ac", DRIVERS=="usb", RUN+="/usr/bin/sg_raw %r/sr%n EA 00 00 00 00 00 01"
@sloev
sloev / git_pre_push_hook_to_prevent_master_push_by_accident.md
Last active February 28, 2022 20:10 — forked from ColCh/README.md
Git pre-push hook to confirm pushing to master

Git pre-push hook

It will check if current branch is master, then ask a confirmation, in case of master branch

install

  1. install a recent version of git (https://git-scm.com/download/mac) eg:

$ brew install git

@danizen
danizen / queries.yaml
Created December 29, 2020 20:00
Non-authorized mechanism to export/convert MeSH RDF to SKOs
prefixes: |
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX meshv: <http://id.nlm.nih.gov/mesh/vocab#>
PREFIX mesh: <http://id.nlm.nih.gov/mesh/>
PREFIX meshsv: <http://id.nlm.nih.gov/mesh/skos/>
Reorg 0 at 2020-01-23T18:01:32 db ID: 85779
Depth 14
Length 13
Est attacker chain duration 2:13:28
Est attacker hashrate 2.53 MH/s
Nicehash hashrate 3.41 MH/s
Nicehash price 0.86 BTC/MH/s/Day
Est Nicehash cost 0.2013653 BTC
Reorg Blocks
@discdiver
discdiver / jupyterlab_shortcuts.md
Last active April 17, 2024 18:16
Common Jupyter Lab Keyboard Shortcuts

If you are on a Mac, substitute command for control. Don't type the + (it means press both keys at once).

Shortcuts when in either command mode (outside the cells) or edit mode (inside a cell):

  • Shift + Enter run selected cell or cells - if no cells below, insert a code cell below

  • Ctrl + B toggle hide/show left sidebar

  • Ctrl + S save and checkpoint

  • Ctrl + Shift + S save as

@metalicjames
metalicjames / btg-attacks.md
Last active March 4, 2024 08:22
Bitcoin Gold (BTG) was 51% attacked

Bitcoin Gold (BTG) was 51% attacked

Preamble

Bitcoin Gold is a Bitcoin hard-fork that aims to be GPU-mineable by using the Equihash algorithm with parameters (144, 5) also known as "Zhash". The Bitcoin Gold website claims Zhash "uses more memory than an ASIC can muster, but runs fine on many graphics cards". Bitcoin Gold was previously 51% attacked in May 2018 when it was estimated that up to $18 million worth of BTG was double-spent.

The Attacks

Between Thursday and Friday we detected two deep reorgs on BTG, both of which contained double-spends. Their details are listed below. All times are GMT.

@dhimmel
dhimmel / bitcoin-random-outcomes.ipynb
Last active January 29, 2018 19:14
Using Bitcoin to randomly determine a future outcome involving untrusted parties
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sorce
sorce / send_counterparty_from_trezor.py
Last active November 5, 2019 11:03
Create, sign and send a counterparty transaction from an address controlled by a trezor
#!/usr/bin/env python
'''
if you find this script helpful and would like to give some crypto to
the cause, we would be very happy to receive it :)
donate bitcoin / counterparty: 3L19gTtMMJHpkAjYVduUZETdduwAfM7NGR
'''
import sys
import json
import requests
from requests.auth import HTTPBasicAuth