Skip to content

Instantly share code, notes, and snippets.

@freakboy3742
freakboy3742 / android.py
Last active October 23, 2019 16:30
One app, three platforms...
import android
from android.app import AlertDialog
from android.graphics import Color
from android.graphics.drawable import ColorDrawable
from android.os import AsyncTask
from android.os import Looper
from android.os import Handler
from android.util import TypedValue
from android.view import View
from android.view import MenuItem
@yakky
yakky / pico.py
Last active March 16, 2018 09:36
Micro hello world Python Web Framework Royal Rumble @PyCon 7
import django
DEBUG, ROOT_URLCONF, DATABASES, SECRET_KEY = 1, 'pico', {'default': {}}, 'p'
urlpatterns = [django.conf.urls.url(r'^(?P<name>\w+)?$', lambda request,
name: django.http.HttpResponse('hello %s!' % (name or 'world')))]
@bmispelon
bmispelon / proposals.csv
Last active April 16, 2016 19:19
Submission dates for DjangoCon Europe 2016 talk proposals
Submission date
2015-11-30 16:26:16.606661+00:00
2015-11-30 16:28:55.057075+00:00
2015-11-30 16:33:19.810559+00:00
2015-11-30 19:03:28.456260+00:00
2015-12-01 01:27:36.614022+00:00
2015-12-01 13:34:26.732966+00:00
2015-12-01 16:11:32.344703+00:00
2015-12-01 18:47:16.003879+00:00
2015-12-02 09:42:07.314961+00:00
@oscarmorrison
oscarmorrison / IFTTTDate.md
Last active January 29, 2025 23:07
Make IFTTT Date Format play nice with Google Spreadsheets

##Date and Time

=TIMEVALUE(SUBSTITUTE("{{OccurredAt}}"," at ", " ")) + DATEVALUE(SUBSTITUTE("{{OccurredAt}}"," at ", " "))

##Date

=DATEVALUE(SUBSTITUTE("{{OccurredAt}}"," at ", " "))

##Time

@hfreire
hfreire / qemu_osx_rpi_raspbian_jessie.sh
Last active February 4, 2025 00:47
How to emulate a Raspberry Pi (Raspbian Jessie) on Mac OSX (El Capitan)
# Install QEMU OSX port with ARM support
sudo port install qemu +target_arm
export QEMU=$(which qemu-system-arm)
# Dowload kernel and export location
curl -OL \
https://github.com/dhruvvyas90/qemu-rpi-kernel/blob/master/kernel-qemu-4.1.7-jessie
export RPI_KERNEL=./kernel-qemu-4.1.7-jessie
# Download filesystem and export location
@kylemcdonald
kylemcdonald / CameraImage.cpp
Created November 23, 2015 15:30
openFrameworks app for sending images to disk for processing, and reading text back from disk. Used for "NeuralTalk and Walk".
#include "ofMain.h"
#include "ofxTiming.h"
class ofApp : public ofBaseApp {
public:
ofVideoGrabber grabber;
DelayTimer delay;
ofTrueTypeFont font;
string description;
@maurisvh
maurisvh / spectrogram.py
Last active January 27, 2025 18:47
ANSI art spectrogram viewer that reads audio from a microphone
#!/usr/bin/python
import numpy
import pyaudio
import re
import sys
WIDTH = 79
BOOST = 1.0
@iminurnamez
iminurnamez / state_engine.py
Last active June 12, 2024 15:49
Simple state engine example
#This code is licensed as CC0 1.0 (https://creativecommons.org/publicdomain/zero/1.0/legalcode).
import sys
import pygame as pg
class Game(object):
"""
A single instance of this class is responsible for
managing which individual game state is active

aws-cli bash helper functions

The official AWS command line tools, have support for configuration profiles. See Configuring the AWS Command Line Interface - Named Profiles.

Managing multiple profiles with the AWS CLI itself is relatively straight forward, switching between them with --profile flag on the command line or the AWS_PROFILE environment variable.

These helpers extend that functionality for convenience with other tools in the ecosystem.

aws-profile

@gabrielfalcao
gabrielfalcao / README.md
Last active October 17, 2015 14:31
boot2docker-compatible, self-contained example of using docker-py to pull a redis python image, build a dockerfile with a python script in it, run that python script linked to the redis container and see the magic !

docker-py + pure python tarball generation

If you are in a linux box running docker or a MacOS running boot2docker, and have 5 minutes to spare, just install docker-py:

pip install docker-py

And run the script above.