Skip to content

Instantly share code, notes, and snippets.

View shujaatak's full-sized avatar

Shujaat Ali Khan shujaatak

View GitHub Profile
@roipeker
roipeker / main.dart
Created June 4, 2021 19:54
GraphX issue #19: simpler gesture transform (zoom, drag, rotate)
/// live demo: https://graphx-gesture-simple.surge.sh
import 'package:flutter/material.dart';
import 'package:graphx/graphx.dart';
import 'package:graphx_zoompan/simple_zoom.dart';
void main() {
runApp(AppSimpleZoom());
}
@roipeker
roipeker / main.dart
Created June 4, 2021 16:38
GraphX issue #19: gesture detector sample (zoom/pan/rotation with easing)
import 'package:flutter/material.dart';
import 'package:graphx/graphx.dart';
import 'zoom_scene.dart';
/// Live demo:
/// https://graphx-gesture-sample.surge.sh
///
void main() {
@shujaatak
shujaatak / binance-liquidation-calculator.py
Created June 3, 2021 14:03 — forked from highfestiva/binance-liquidation-calculator.py
CLI Binance liquidation calculation formula
#!/usr/bin/env python3
'''2021-03-26: Reverse-engineer by searching for the following terms in features*.js:
- bracketMaintenanceMarginRate
- cumFastMaintenanceAmount
- bracketNotionalFloor
- bracketNotionalCap'''
# (max) position, maintenance margin, maintenance amount
maint_lookup_table = [
# Using QThreads in PyQt5 using worker model
# There is so many conflicting posts on how QThreads should be used in pyqt. I had
# been subclassing QThread, overriding the run function, and calling start to run
# the thread. I did it this way, because I couldn't get the worker method (where
# an object is moved to a thread using moveToThread) to do what I wanted. It turns
# out that I just didn't understand why. But, once I worked it out I have stuck with
# the moveToThread method, as this is recommended by the official docs.
#
# The key part for me to understand was that when I am running a heavy calculation in
@highfestiva
highfestiva / binance-liquidation-calculator.py
Last active February 20, 2025 16:44
CLI Binance liquidation calculation formula
#!/usr/bin/env python3
'''2021-03-26: Reverse-engineer by searching for the following terms in features*.js:
- bracketMaintenanceMarginRate
- cumFastMaintenanceAmount
- bracketNotionalFloor
- bracketNotionalCap'''
# (max) position, maintenance margin, maintenance amount
maint_lookup_table = [
@csm10495
csm10495 / Building OpenSSL 1.1.1(b) Notes
Last active September 5, 2024 05:54
Building OpenSSL 1.1.1(b) Notes (Windows)
Required: Visual Studio 2015 or 2017 (or probably later works)
Setup
1. Clone/download OpenSSL 1.1.1 source to a folder
2. Download / install Perl (They recommend Active perl)
I recommend using Chocolatey so for me: choco install activeperl
3. Ensure Perl is in the system path. (Choco appears to do this by default)
4. Download / install NASM
I recommend using Chocolatey so for me: choco install nasm
5. Ensure NASM is in the system path. (For me the directory to add was C:\Program Files\NASM)
// vscode-keybindings for navigation with I/J/K/L and additional functionality with surrounding characters
// Place your key bindings in this file to overwrite the defaults
// ALT + I/J/K/L: up/left/down/right
// ALT + SHIFT + I/J/K/L: mark text up/left/down/right
// CTRL + J/L: send cursor to start/end of line
// CTRL + ALT + J/L: send cursor to start/end of word
// CTRL + ALT + U/O: send cursor to "wordPartLeft"/"wordPartRight"
// CTRL + ALT + SHIFT + U/O: mark from cursor to "wordPartLeft"/"wordPartRight"
// CTRL + ALT + Y: got to declaration
@JBlackCat
JBlackCat / fragment_shader_tutorials.glsl
Created March 27, 2017 18:48
GLSL Beginner Tutorials from ShaderToy.com
/*
by Uğur Güney. March 8, 2014.
Hi! I started learning GLSL a month ago. The speedup gained by using
GPU to draw real-time graphics amazed me. If you want to learn
how to write shaders, this tutorial written by a beginner can be
a starting place for you.
Please fix my coding errors and grammar errors. :-)
@jazzycamel
jazzycamel / threads1.py
Last active September 28, 2024 08:06
Simple example of the correct way to use (Py)Qt(5) and QThread
# Copyright (c) 2016 Rob Kent (jazzycamel)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software
# and associated documentation files (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge, publish, distribute,
# sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or
# substantial portions of the Software.
@odan
odan / xampp_php7_xdebug.md
Last active June 4, 2025 12:43
Installing Xdebug for XAMPP