Skip to content

Instantly share code, notes, and snippets.

View Nanguage's full-sized avatar

Weize Nanguage

View GitHub Profile
@manzt
manzt / GameOfLife.ipynb
Last active June 8, 2025 16:50
Anywidget using WebGPU to simulate and render Conway's Game of Life
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bollwyvl
bollwyvl / OpenAI API in JupyterLite JS Knerel.ipynb
Last active January 14, 2024 09:27
OpenAI API in JupyterLite
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@oeway
oeway / PythonPlugin.imjoy.html
Last active June 30, 2023 01:30
Read image file with Pyodide in ImJoy
<docs lang="markdown">
[TODO: write documentation for this plugin.]
</docs>
<config lang="json">
{
"name": "PythonPlugin",
"type": "web-python",
"version": "0.1.0",
"description": "[TODO: describe this plugin with one sentence.]",
@oeway
oeway / VizarrReferenceStore-Zenodo.imjoy.html
Last active October 19, 2023 03:17
Upload large files to zenodo and serve it as a zarr store (not working yet because zenodo doesn't support range header)
<docs>
[TODO: write documentation for this plugin.]
</docs>
<config lang="json">
{
"name": "VizarrReferenceStore",
"type": "web-worker",
"tags": [],
"ui": "",
@pfandzelter
pfandzelter / bar_chart.ipynb
Last active September 2, 2024 14:21
Bar Chart With a Broken Y Axis in Python Using Seaborn
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gvoze32
gvoze32 / ffmpeg GIF to MP4.MD
Last active March 18, 2025 15:44
Convert animated GIF to MP4 using ffmpeg in terminal.

To convert animation GIF to MP4 by ffmpeg, use the following command

ffmpeg -i animated.gif -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" video.mp4

Description

movflags – This option optimizes the structure of the MP4 file so the browser can load it as quickly as possible.

pix_fmt – MP4 videos store pixels in different formats. We include this option to specify a specific format which has maximum compatibility across all browsers.

@dabeaz
dabeaz / README.txt
Created October 15, 2019 20:10
PyCon India 2019, Code from Keynote Presentation by @dabeaz
Code from PyCon India 2019 Keynote Talk
David Beazley (https://www.dabeaz.com)
======================================
This code is presented "as is" and represents what was live-coded
during my closing keynote presentation at PyCon India, Chennai,
October 13, 2009. I have made no changes to the files.
Requires: Python 3.6+, numpy, pygame
@docPhil99
docPhil99 / opencv_qt_label.md
Last active April 18, 2025 08:39
How to display opencv video in pyqt apps

The code for this tutorial is here

Opencv provides are useful, but limited, method of building a GUI. A much more complete system could be acheived using pyqt. The question is, how do we display images. There are quite a few possible routes but perhaps the easiest is to use QLabel since it has a setPixmap function. Below is some code that creates two labels. It then creates a grey pixmap and displays it one of the labels. code: staticLabel1.py

from PyQt5.QtWidgets import QWidget, QApplication, QLabel, QVBoxLayout
from PyQt5.QtGui import QPixmap, QColor
import sys
@mrtns
mrtns / README.md
Last active September 26, 2024 18:38
Markdown-based Literate Programming

R Ecosystem

  • R Markdown

    Use a productive notebook interface to weave together narrative text and code to produce elegantly formatted output. Use multiple languages including R, Python, and SQL.

Python Ecosystem

  • Pweave

    Pweave is a scientific report generator and a literate programming tool for Python. It can capture the results and plots from data analysis and works well with numpy, scipy and matplotlib.

  • podoc
@aparrish
aparrish / understanding-word-vectors.ipynb
Last active May 8, 2025 14:50
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.