Skip to content

Instantly share code, notes, and snippets.

View mapofemergence's full-sized avatar
🍳
Researching

Stefano Cieri mapofemergence

🍳
Researching
View GitHub Profile
@bradmontgomery
bradmontgomery / dummy-web-server.py
Last active November 13, 2024 16:11
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python (Updated for Python 3.7)
Usage:
./dummy-web-server.py -h
./dummy-web-server.py -l localhost -p 8000
Send a GET request:
@dbr
dbr / nuke_viewer_shortcut_intercept.py
Created June 4, 2013 04:12
Test of finding Nuke's viewer widget, and intercepting the hardwired "c" shortcut and rewiring it to view the RGB channel
"""Test of finding Nuke's viewer widget, and intercepting the hardwired "c" shortcut and rewiring it to view the RGB channel
"""
from PySide import QtGui, QtCore
def findviewer():
stack = QtGui.QApplication.topLevelWidgets()
viewers = []
while stack:
@celoyd
celoyd / ndvi.py
Last active October 4, 2022 11:03
#!/usr/bin/env python
# ndvi.py red.tif nir.tif output-ndvi.tif
# Calculate NDVI (see Wikipedia). Assumes atmospheric correction.
# (Although I use it without all the time for quick experiments.)
import numpy as np
from sys import argv
from osgeo import gdal, gdalconst
#!/usr/bin/python
# https://timwise.co.uk/2014/02/03/converting-kml-to-gpx-with-python/
# https://gist.github.com/timabell/8791116
import argparse
import xml.sax
parser = argparse.ArgumentParser(description='Convert annoying google android my tracks kml data to sensible gpx files')
parser.add_argument('input_file')
==============================
Expression: (id=\d)(.+?)(")
==============================
Python script to download:
import os.path
@Kindrat
Kindrat / guide.md
Last active September 10, 2022 11:48
Liquid feedback Installation Guide

Tested requirements:

  • Ubuntu 14.04 LTS amd64
  • PostgreSQL 9.3.4
  • lf-core 3.0.1
  • webmcp 1.2.5
  • rocketwiki-lqfb 0.4
  • lf-frontend 2.2.5
  • lighttpd 1.4.33-1+nmu2ubuntu2

Add postgresql repository (check distro version). Create /etc/apt/sources.list.d/pgdg.list. Add there deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main

@alexland
alexland / serialize-numpy-array.py
Last active November 28, 2023 07:12
serialize, persist, retrieve, and de-serialize a NumPy array as a binary string (any dimension, any dtype); exemplary use case: a web app calculates some result--eg, from a Machine Learning algorithm, using NumPy and the result is a NumPy array; it is efficient to just return that result to rather than persist the array then retrieve it via query
import time
import numpy as NP
from redis import StrictRedis as redis
# a 2D array to serialize
A = 10 * NP.random.randn(10000).reshape(1000, 10)
# flatten the 2D NumPy array and save it as a binary string
array_dtype = str(A.dtype)
@nathanielanozie
nathanielanozie / naNurbsCurveControl.py
Created February 13, 2015 13:02
Glue(Rivet) some nulls to NurbsCurve (Maya, Python Script)
#######
#Help with building Facial Rig User interface secondary movers
#By
#Nathaniel O. Anozie (ogbonnawork at gmail dot com)
#
#Inspired by Andy Van Straten -- learning about joints riding on curves
#Inspired by Fabio Bonvicini -- i was inspiredy by his curve based online tutorials on facial rigs
#
#
#see also naNurbsSurfaceControl, naFaceBuffer (more phoneme based) na_faceIt.py (more ui based)
@ataffanel
ataffanel / map.html
Created April 20, 2015 14:12
Simple OSM map view in pyqt using QtWebkit
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
<style>
body { padding: 0; margin: 0; }
html, body, #map { height: 100%; }
</style>
</head>
@jedypod
jedypod / README.md
Last active February 29, 2024 20:33
Nuke ffmpeg Render

Nuke ffmpeg Render

Writeffmpeg is a python script and a node that allows you to render from Nuke directly into ffmpeg. Instead of a 2 step process where you render from Nuke to a temporary image sequence that you then transcode using ffmpeg, this solution writes to a single uint16 cache tiff file and this data gets piped into ffmpeg.

I've included a little screen recordingto help demo how it works.

Files

ffmpeg_render.py Writeffmpeg.nk

Dependencies