Skip to content

Instantly share code, notes, and snippets.

View KelSolaar's full-sized avatar
🔅
Bending Light

Thomas Mansencal KelSolaar

🔅
Bending Light
View GitHub Profile
@mwouts
mwouts / Debug Jupyter notebooks in Pycharm.md
Last active December 9, 2022 16:47
2018-06 Debug Jupyter notebooks with PyCharm

Did you ever had to debug some large cell in a Jupyter notebook? In the below I share my experience on the subject. We'll review the classical methods for debugging notebooks, and finally I'll show how to set breakpoints in PyCharm for code being execute in a jupyter notebook, and benefit of the comfort of a real Python IDE for debugging.

Debug in the notebook

Before I actually describe what Pycharm can do, we quickly review the jupyter commands for debugging.

Catch exceptions

@Joshua1989
Joshua1989 / Transferring files between Google Colab and Google Drive.md
Last active October 12, 2023 08:38
file transferring between Google Colab VM and Google Drive

There are several approaches

  • Mount Google Drive in local Colab VM
  • Upload and download via browser
  • Use colab_util.py in python script
@zachlewis
zachlewis / OutputTransformThing
Created February 7, 2018 22:34
are you down with OTT?
set cut_paste_input [stack 0]
version 11.1 v1
push $cut_paste_input
Group {
name ACES_OT
tile_color 0xd4282ff
label "\[? \[numvalue presets]==0 \"\" \[value presets]]"
note_font "Bitstream Vera Sans Bold Bold Bold Bold Bold Bold Bold"
note_font_color 0xffffffff
selected true
@andyneff
andyneff / rokh.py
Last active May 8, 2024 16:43
Python file for parsing uasset files from Rokh
import logging
import re
import collections
import struct
from StringIO import StringIO
import codecs
import binascii
import math
import sys
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active May 20, 2025 20:12
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@vshotarov
vshotarov / shelfBase.py
Last active February 10, 2025 03:18
Maya base class for building custom shelves.
import maya.cmds as mc
def _null(*args):
pass
class _shelf():
'''A simple class to build shelves in maya. Since the build method is empty,
it should be extended by the derived class to build the necessary shelf elements.
@simonw
simonw / recover_source_code.md
Last active September 28, 2024 08:10
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
@szukalski
szukalski / fail2ban-ufw-logwatch.sh
Last active November 2, 2024 18:31
fail2ban ufw logwatch
#!/bin/bash
# Run as root
if [ "$#" -ne 1 ];
then
echo "Usage: <script> <username>"
exit 1
fi
USER=$1
[email protected]
@gregorynicholas
gregorynicholas / jsonrpc.py
Created October 2, 2016 09:49
jsonrpc / python
#!/usr/bin/env python
# -*- coding: ascii -*-
#: see: https://github.com/dasmith/stanford-corenlp-python/blob/master/jsonrpc.py
"""
JSON-RPC (remote procedure call).
It consists of 3 (independent) parts:
- proxy/dispatcher
- data structure / serializer
- transport
@nikolajbaer
nikolajbaer / .gitignore
Last active April 24, 2024 13:43
STL from python server to Three.js viewer example
bin
.Python
lib
include
pip-selfcheck.json