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
@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 19, 2024 16:16
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 23, 2023 23:49
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 May 19, 2024 04:54
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 July 4, 2022 18:44
fail2ban ufw logwatch
#!/bin/bash
# Run as root
if [ "$#" -ne 1 ];
then
echo "Usage: <script> <username>"
exit 1
fi
USER=$1
EMAIL=your.email.address@gmail.com
@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
@williballenthin
williballenthin / strings.py
Last active July 14, 2022 21:10
Extract ASCII and Unicode strings using Python.
import re
from collections import namedtuple
ASCII_BYTE = " !\"#\$%&\'\(\)\*\+,-\./0123456789:;<=>\?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\[\]\^_`abcdefghijklmnopqrstuvwxyz\{\|\}\\\~\t"
String = namedtuple("String", ["s", "offset"])