Skip to content

Instantly share code, notes, and snippets.

@highfestiva
highfestiva / bitmex-liquidation-calculator.py
Created October 26, 2019 20:54
cli bitmex liquidation calculation formula, minimal implementation
#!/usr/bin/env python3
import argparse
from math import ceil, floor
sign = lambda amt: -1 if amt<0 else (1 if amt>0 else 0)
class dobj:
@johncantrell97
johncantrell97 / satoshistreasure.md
Last active April 15, 2023 15:09
How I Obtained Satoshi's Treasure Keys 1, 2, and 3 in Minutes

Today (April 16th 2019 at noon) the first major clues to discover key #1 was set to be released in a few cities. A QR code with the words 'orbital' were found at these locations and looked like this: (https://imgur.com/a/6rNmz7T). If you read the QR code with your phone you will be directed to this url: https://satoshistreasure.xyz/k1

At this URL you are prompted to input a passphrase to decrypt the first shard. An obvious first guess was to try the word 'orbital' from the QR code. Not suprisingly this worked! This reveals a congratulations page and presents the first key shard:

ST-0001-a36e904f9431ff6b18079881a20af2b3403b86b4a6bace5f3a6a47e945b95cce937c415bedaad6c86bb86b59f0b1d137442537a8.

Now, we were supposed to wait until April 17th to get clues from the other cities for keys #2 and #3 but that wouldn't stop me from digging around with all the new information we had. All that time "playing" notpron (http://notpron.org/notpron/) years ago was going to help me here.

The first thing I noticed was

#!/usr/bin/env python3
import asyncio
import time
import aiohttp
START = time.monotonic()
@Nikhil-Kasukurthi
Nikhil-Kasukurthi / visualisation.py
Last active December 13, 2022 16:55
Visualisation of CNN using Grad-Cam on PyTorch
import cv2
import numpy as np
import torch
from torchvision import models, transforms
from torch.autograd import Variable
import torch
import torch.nn as nn
import pickle
import os
import argparse
@fortinmike
fortinmike / CustomVuforiaNativeRendererController.mm
Last active February 10, 2022 22:43
A rough guide on how to embed a Unity view in a native iOS or React Native-based app
// NOTE: Copied and cleaned-up from Unity/Libraries/VuforiaNativeRendererController.mm
// REASON: The .mm file did not expose an interface and categorically overrode the Unity app delegate subclass
// using `IMPL_APP_CONTROLLER_SUBCLASS(VuforiaNativeRendererController)`, preventing us from providing our own
// subclass of `VuforiaNativeRendererController` to serve as the final app delegate. Diff this file with the
// source file (specified above) to view the applied changes.
#import "CustomVuforiaNativeRendererController.h"
#import "VuforiaRenderDelegate.h"
// Unity native rendering callback plugin mechanism is only supported
@lassoan
lassoan / ExtractSkin.py
Last active May 24, 2022 17:53
This example demonstrates how to extract skin surface from an MRI image using thresholding and smoothing effect of Segment Editor
import SampleData
sampleDataLogic = SampleData.SampleDataLogic()
masterVolumeNode = sampleDataLogic.downloadMRHead()
# Create segmentation
segmentationNode = slicer.mrmlScene.AddNewNodeByClass("vtkMRMLSegmentationNode")
segmentationNode.CreateDefaultDisplayNodes() # only needed for display
segmentationNode.SetReferenceImageGeometryParameterFromVolumeNode(masterVolumeNode)
addedSegmentID = segmentationNode.GetSegmentation().AddEmptySegment("skin")
@Geoyi
Geoyi / install virtualenv ubuntu 16.04.md
Created September 16, 2017 12:19 — forked from frfahim/install virtualenv ubuntu 16.04.md
How to install virtual environment on ubuntu 16.04

How to install virtualenv:

Install pip first

sudo apt-get install python3-pip

Then install virtualenv using pip3

sudo pip3 install virtualenv 
@Thimira
Thimira / keras_bottleneck_multiclass.py
Last active April 13, 2021 05:52
Learn how to build a multi-class image classification system using bottleneck features from a pre-trained model in Keras to achieve transfer learning. Tutorial: https://www.codesofinterest.com/2017/08/bottleneck-features-multi-class-classification-keras.html
'''
Using Bottleneck Features for Multi-Class Classification in Keras
We use this technique to build powerful (high accuracy without overfitting) Image Classification systems with small
amount of training data.
The full tutorial to get this code working can be found at the "Codes of Interest" Blog at the following link,
https://www.codesofinterest.com/2017/08/bottleneck-features-multi-class-classification-keras.html
Please go through the tutorial before attempting to run this code, as it explains how to setup your training data.
@mingrui
mingrui / CleanupMissingScripts.cs
Created July 28, 2017 02:15
Unity Editor Script to help cleaning up missing script references on gameobjects
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
public class CleanupMissingScriptsHelper{
[MenuItem("Edit/Cleanup Missing Scripts")]
static void CleanupMissingScripts() {
for (int i = 0; i < Selection.gameObjects.Length; i++) {
var gameObject = Selection.gameObjects[i];
@tomokishii
tomokishii / README.md
Last active August 21, 2018 05:26
Modern Gradient Boosting models and Scikit-learn GridSearchCV

Modern Gradient Boosting models - how to use GridSearchCV

My current environment is...

  • Python 3.5.2
  • Scikit-learn 0.18.1
  • XGBoost (python-package) 0.6
  • LightGBM (python-package) v2.0