Skip to content

Instantly share code, notes, and snippets.

@sterin
sterin / CMakeLists.txt
Last active November 7, 2022 12:28
An example showing how to use sub interpreters and threads in Python
cmake_minimum_required(VERSION 2.8.4)
project(py1)
find_package(PythonLibs REQUIRED)
include_directories(${PYTHON_INCLUDE_DIRS})
ADD_DEFINITIONS( -std=c++11 )
set(SOURCE_FILES main.cpp)
@takluyver
takluyver / asyncio_magic.py
Created January 25, 2016 11:53
Cell magic for 'await' expressions in IPython
# (c) Thomas Kluyver, 2016
# Use it under the MIT license
# This is fairly experimental. Use at your own risk.
import ast
from ast import Call, Attribute, Name, Load
import asyncio as asyncio_mod
#import astpp
from IPython.utils.text import indent
@fgeorges
fgeorges / README.md
Last active July 7, 2024 20:38
Graph with expandable nodes, with D3

Note: A solution has been found, see below.

I am trying to create an SVG graph of nodes with D3, with "expandable nodes." That is, when one clicks on a node, its siblings are added to the graph (or more precisely: its siblings in the graph data are added to the graph visualization.)

The visualization uses a d3 force simulation (using D3 v5). When a node (an SVG circle) is clicked, the simulation is stopped (in case it was still running, to make sure there is no new node with no coordinates added in the middle of a run,) the corresponding nodes and links are added to the corresponding arrays,

@ezklap
ezklap / iplog.py
Last active April 19, 2024 14:51
Apex Legends IP logger
from scapy.all import *
import time
from pynput.keyboard import Key, KeyCode, Listener
import socket
'''
A python 3 script that captures the game servers IP address written for Apex Legends
you can use this for any game just look at the UDP port via wireshark and change it
on the script.
Matchmaking issue : I wrote a python script that helped me log the game servers IP addresses i was connecting to, as I had noticed 2 out of 3 matches in ranked mode I was connecting to LAGY servers , turns out Apex Matchmaking connected me to servers on the other side of the planet (400+ ms pings) and not close to the region I had selected in the game's settings.