Skip to content

Instantly share code, notes, and snippets.

View lrq3000's full-sized avatar
🎵

Stephen Karl Larroque lrq3000

🎵
View GitHub Profile
@ChuckJHardy
ChuckJHardy / gource.md
Last active August 12, 2022 00:22
Gource Recording for Git

Install Gource

brew install gource

Convert Quicktime Movie to Animated Gif

ffmpeg -i in.mov -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > out.gif

Record Gource

@eirikb
eirikb / clicktest.md
Last active April 9, 2021 16:49
Automated click testing in bash

About

This is a bash script, as an example, on how to do click-testing GUI based on finding components based on how they look.

Dependencies

@lotabout
lotabout / google-translate.py
Last active November 11, 2020 13:07
Translate texts
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# translate utility that utilize google translator, support python2 & python3
# Note that the order or arguments in the URL matters.
try:
from urllib import urlencode
except:
from urllib.parse import urlencode
@lrq3000
lrq3000 / diss.py
Last active November 11, 2020 19:05
Recursive Python bytecode disassembler
import dis
import types
def getFuncByName(fname):
possibles = globals().copy()
possibles.update(locals())
f = possibles.get(fname)
if f:
return f
else:
@chrisgorgo
chrisgorgo / pysurfer_blog_post.ipynb
Created December 15, 2015 18:55
Pysurfer automatic plotting
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@danstowell
danstowell / wiener_deconvolution_example.py
Last active April 19, 2024 09:41
Simple example of Wiener deconvolution in Python
#!/usr/bin/env python
# Simple example of Wiener deconvolution in Python.
# We use a fixed SNR across all frequencies in this example.
#
# Written 2015 by Dan Stowell. Public domain.
import numpy as np
from numpy.fft import fft, ifft, ifftshift
@mciantyre
mciantyre / KmlToCsv.py
Last active January 29, 2025 18:36
KML to CSV in Python
"""
A script to take all of the LineString information out of a very large KML file. It formats it into a CSV file so
that you can import the information into the NDB of Google App Engine using the Python standard library. I ran this
script locally to generate the CSV. It processed a ~70 MB KML down to a ~36 MB CSV in about 8 seconds.
The KML had coordinates ordered by
[Lon, Lat, Alt, ' ', Lon, Lat, Alt, ' ',...] (' ' is a space)
The script removes the altitude to put the coordinates in a single CSV row ordered by
[Lat,Lon,Lat,Lon,...]
import os
import math
import time
import numpy
import pandas
import random
import matplotlib
import numpy.random as nrand
import matplotlib.pylab as plt
from sklearn.preprocessing import normalize
@StuartGordonReid
StuartGordonReid / AntNeighbourhoodFunction.py
Last active August 6, 2016 12:06
Ant Colony Neighbourhood Function
def get_probability(self, d, y, x, n, c):
"""
This gets the probability of drop / pickup for any given Datum, d
:param d: the datum
:param x: the x location of the datum / ant carrying datum
:param y: the y location of the datum / ant carrying datum
:param n: the size of the neighbourhood function
:param c: constant for convergence control
:return: the probability of
"""
@flarb
flarb / SDKSwap.cs
Created May 23, 2015 18:50
Swap between Unity3D Google Cardboard and Gear VR / OVR Mobile SDKs. It swaps out the Android manifest files when you switch platforms--pretty much all you need (aside from wrapping the APIs) to switch platforms.
using UnityEngine;
using System.Collections;
using UnityEditor;
using System.IO;
public class SDKSwap : EditorWindow {
static string _cardboardPath;
static string _OVRPath;