Skip to content

Instantly share code, notes, and snippets.

View tdamdouni's full-sized avatar

Taha Dhiaeddine Amdouni tdamdouni

View GitHub Profile
@baby-bird
baby-bird / Time_Timer_Black.py
Last active September 4, 2023 04:42
Time_Timer_Black.py
'''
A simple Time Timer Black Theme app made of ShapeNodes.
<Change Line 123 for seconds or minutes counting>
<Uncomment Line 129 and fill in your shortcut name to
automatically run other shortcut you defined
after timer stopped>
Odd touch attemps will start the timer
Even touch attemps will stop the timer
Stops automatically when the set times passed
'''
@baby-bird
baby-bird / Time_Timer.py
Last active March 8, 2024 21:48
Time_Timer.py
'''
A simple Time Timer app made of ShapeNodes.
<Change Line 120 for seconds or minutes counting>
<Uncomment Line 126 and fill in your shortcut name to
automatically run other shortcut you defined
after timer stopped>
Odd touch attemps will start the timer
Even touch attemps will stop the timer
Stops automatically when the set times passed
'''
@vwillcox
vwillcox / scan4pi.py
Last active September 17, 2017 21:26
#! /usr/bin/python
# Python3 code to print IP addresses and host name of local network
# to e-ink screen
import nmap
import sys
import socket
from gpiozero import RGBLED, Button
import smbus
@alexellis
alexellis / HackingOnLiveStreaming.md
Created June 1, 2017 12:48
HackingOnLiveStreaming

Additional notes

Original blog post - http://blog.alexellis.io/live-stream-with-docker/

How do I rebuild the image from scratch?

This will take several hours on a Raspberry Pi Zero - but less time on a Pi 2 or Pi 3. You can edit the Dockerfile for a Pi 2/3 and change RUN make to RUN make -j 4 to take advantage of the quad-core processor.

$ git clone https://github.com/alexellis/raspberrypi-youtube-streaming/
anonymous
anonymous / jbonb.py
Created May 9, 2017 12:34
jbonb.py
#!python3
import ui
from collections import OrderedDict
class MyTableViewDataSource (object):
def __init__(self, data_dict=None):
self.data = data_dict
def section_key(self, section):
#return self.data.keys()[section]

Install dlib and face_recognition on a Raspberry Pi

Instructions tested with a Raspberry Pi 2 with an 8GB memory card. Probably also works fine on a Raspberry Pi 3.

Steps

Download the latest Raspbian Jessie Light image. Earlier versions of Raspbian won't work.

Write it to a memory card using Etcher, put the memory card in the RPi and boot it up.

@paultopia
paultopia / twitter-dejerk.py
Last active March 30, 2017 21:44
twitter-dejerk.py
# written for pythonista ios app, takes advantage of its library and access to ios twitter login. generates a list of followers who don't follow you back and lets you look at each individually to decide whethee to dispose of them or not. Only works for followers < 5000 amd following < 5000, else rate limits and cursors get imvolved and are icky. could use a real UI.
import twitter, json, webbrowser, random
account = twitter.get_all_accounts()[0]
followers = frozenset(json.loads(twitter.request(account, "https://api.twitter.com/1.1/followers/ids.json", "GET")[1].decode("utf-8"))["ids"])
ifollow = frozenset(json.loads(twitter.request(account, "https://api.twitter.com/1.1/friends/ids.json", "GET")[1].decode("utf-8"))["ids"])
not_following_back = list(ifollow.difference(followers))
def make_url(id):
return 'https://twitter.com/intent/user?user_id=' + str(id)
turls = [make_url(id) for id in not_following_back]
@paultopia
paultopia / script-from-dropbox.py
Last active March 28, 2017 18:34
Easy pythonista script to use from dropbox iOS app share sheet to take dropbox link to python script and save it to pythonista filesystem. Also works with "raw" python scripts from github and gists.
import requests, appex
from urllib.parse import urlparse
url = appex.get_url().replace("dl=0", "dl=1")
r = requests.get(url)
filename = urlparse(url).path.rpartition("/")[-1].replace(".py", "-downloaded.py")
with open(filename, "wb") as outfile:
outfile.write(r.content)
print("script downloaded as " + filename)
@jsbain
jsbain / quartz.py
Created March 10, 2017 05:08
quartz.py
from ctypes import *
from ctypes import util
from objc_util import *
######################################################################
# QUARTZ / COREGRAPHICS
quartz = c
@Gadgetoid
Gadgetoid / README.md
Last active September 4, 2019 17:23
VLC PHATBEAT Pirate Radio

Starting from Jessie or Jessie Lite

curl get.pimoroni.com/phatbeat | bash

Then install VLC:

sudo apt-get install vlc-nox