Skip to content

Instantly share code, notes, and snippets.

View Guillawme's full-sized avatar
💭
I may be slow to respond (days).

Guillaume Gaullier Guillawme

💭
I may be slow to respond (days).
View GitHub Profile
@cdsousa
cdsousa / blender_julia.py
Last active April 20, 2024 14:40
Julia inside Python inside Blender
bl_info = {
"name": "Julia console",
"blender": (4, 0, 0),
"category": "Scripting",
}
def register():
# install JuliaCall within Blender's Python environment (if not already installed)
import importlib
if importlib.util.find_spec('juliacall') is None:
@bohwaz
bohwaz / lcp_download.php
Created June 29, 2023 20:10
Transform LCP/LCPL files to regular EPUB/PDF/ZIP
#!/usr/bin/php
<?php
// Note: this code does not contain any DRM removal, DRM removal is made by https://notabug.org/NewsGuyTor/DeDRM_tools-LCP
//
// Install steps:
// Debian/Ubuntu/Mint: apt install php-cli python3 python3-cryptodome python3-lxml zip unzip
//
// How to use?
// Just run: php lcp_download.php FILE.LCPL PASSWORD
// A new FILE_decrypted.epub will be created in the same directory
@alisterburt
alisterburt / raps_3d.py
Last active March 28, 2023 19:32
Rotational average 3D for Pranav
from pathlib import Path
from typing import List, Sequence, Tuple
import einops
import mrcfile
import numpy as np
import torch
import typer
cli = typer.Typer(name='raps_3d', no_args_is_help=True, add_completion=False)
#!/usr/bin/env python
import numpy as np
import pandas as pd
import umap
import sys
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.preprocessing import StandardScaler
from cryosparc.dataset import Dataset
@hanjinliu
hanjinliu / microtubule_in_napari.py
Last active June 23, 2022 05:07
Make a microtubule in napari, for illustration.
import napari
import numpy as np
class MtModel:
def __init__(
self,
npf: int = 13,
start: int = 3,
space: float = 4.0,
radius: float = 9.8,
@sneakers-the-rat
sneakers-the-rat / e_hashs.json
Last active February 18, 2022 15:54
Elsevier PDF "hashes"
[
"FCi27mtaKod38ztmGndn-y8NNz.r.lt6SndqGztz_ztr-ngqQm9aMo9eOnMeJntuNntu",
"D2ei2mgqJz9b-m.mGmPqRyLNNnwmOlt7.ywiGmt-Kndr9otqRywv8o9ePmtiNmd2Sn92Tma",
"6U7vcmPuOn9uLnMaGyM7-nLNNntv9lt6RmtaGmweOyMmJnMmSmgmOo9eOnM6LnMaRmM-Tma",
"lXLf8owyQztiMzwqGnMz7zcNNotb7lwf.m9qGzt6Km.qMngqLndqLo9eOotaNm96Mmt6Tma",
"FCi27y9qOnd-Ny96GmPmOmcNNzwf-lwj-m9mGztz7ytaMnM78n9v-o9ePmM6Rm9-Qn9eTma",
"XlEDumMz7nM7-m9iGogmRmLNNyt_8lwiKz9eGm9-Pm.v7ztiLztz_o9eOnMeQnd-Sodm",
"lXLf8yt-JywmNmPeGm9n9n8NNzgn.lt_8zwqGogz7zgn7zt6SyPr-o9eOnM6Pot2Mn9qTma",
"FCi27zgf8mdqMmMeGnMmMy8NNz9eQlweNy.eGmMiMm96Qmgr9nMb-o9ePmtuRmt6JotmTma",
"FCi27nwmKnMeSodeGm.z.y8NNntz.lt-PywmGy9__ngqQmtiPmtb7o9ePmteJotyJoduTma",
@sneakers-the-rat
sneakers-the-rat / clean_pdf.sh
Last active February 14, 2024 16:52
Strip PDF Metadata
# --------------------------------------------------------------------
# Recursively find pdfs from the directory given as the first argument,
# otherwise search the current directory.
# Use exiftool and qpdf (both must be installed and locatable on $PATH)
# to strip all top-level metadata from PDFs.
#
# Note - This only removes file-level metadata, not any metadata
# in embedded images, etc.
#
# Code is provided as-is, I take no responsibility for its use,
@biochem-fan
biochem-fan / NOTES.md
Last active April 24, 2024 13:54
Warp-RELION4-M Protocol
@svpino
svpino / neural-network-from-scratch.py
Last active July 25, 2023 18:04
An implementation of a neural network from scratch
import numpy as np
def sigmoid(x):
return 1 / (1 + np.exp(-x))
def neural_network(X, y):
learning_rate = 0.1
W1 = np.random.rand(2, 4)
W2 = np.random.rand(4, 1)