Skip to content

Instantly share code, notes, and snippets.

View mre's full-sized avatar
🪴
I like plants.

Matthias Endler mre

🪴
I like plants.
View GitHub Profile
i
me
my
myself
we
our
ours
ourselves
you
your
let rects = [];
function visualize(analyser) {
analyser.fftSize = 2048;
var bufferLength = analyser.fftSize;
var dataArray = new Uint8Array(bufferLength);
function run() {
analyser.fftSize = 2048;
var bufferLengthAlt = analyser.frequencyBinCount;
@olooney
olooney / average_image_color.py
Created September 27, 2011 21:14
Average Image Color
from PIL import Image
def average_image_color(filename):
i = Image.open(filename)
h = i.histogram()
# split into red, green, blue
r = h[0:256]
g = h[256:256*2]
b = h[256*2: 256*3]
@mbreese
mbreese / docker-heredoc-snippet
Last active June 12, 2023 21:28
Running docker with a HEREDOC to script the commands to run inside the container.
docker run -v /Users/mbreese/tmp:/tmp1 -w /tmp1 -i centos:7 /bin/bash -s <<EOF
date > foo
echo 'foo' >> foo
cat /etc/redhat-release >> foo
whoami >> foo
EOF
@steve-jansen
steve-jansen / docker-inspect.sh
Created August 19, 2016 01:55
List labels for a docker container
docker inspect -f '{{ range $k, $v := .ContainerConfig.Labels -}}
{{ $k }}={{ $v }}
{{ end -}}' $cid
FROM ubuntu:16.04
RUN PACKAGES="\
php-cli \
php-mysql \
php-intl \
php-xml \
php-curl \
php-dom \
" && \
@ceejbot
ceejbot / deploy.yml
Last active August 11, 2021 16:03
Using Honeycomb's buildevents tool inside a github action
name: deploy service tar
on:
push:
branches:
- 'deploy/*'
jobs:
docker:
name: Build and archive service
runs-on: ubuntu-latest
@TimFletcher
TimFletcher / gunicorn_startup.sh
Created August 20, 2011 14:45
Gunicorn Startup Script
#!/bin/sh
# http://nathanvangheem.com/news/gunicorn-startup-script-for-django
# Place the script in the file - /etc/init.d/gunicorn or whatever you'd like to call it
# make it executable - chmod +x /etc/init.d/gunicorn
# And finally, wire it up - update-rc.d gunicorn defaults
ADDRESS='127.0.0.1'
PYTHON="/opt/django/bin/python"
GUNICORN="/opt/django/bin/gunicorn_django"
@justinmeza
justinmeza / remote.lol
Created December 1, 2014 17:01
connecting to a remote TCP server in LOLCODE
HAI 1.3
CAN HAS SOCKS?
I HAS A local
local R I IZ SOCKS'Z BIND YR "ANY" AN YR 12345 MKAY
BTW get an IP address
I HAS A addr ITZ I IZ SOCKS'Z RESOLV YR "google.com" MKAY
BTW connect to a remote port
@laradevitt
laradevitt / index.html
Last active May 20, 2019 22:57
An adaptation of "Light YouTube Embeds by @labnol". Also embeds Vimeo; didn't need to build thumbnail url. Vanilla JS.
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title></title>
<link rel="stylesheet" href="styles.css">
<script src="scripts.js"></script>