Skip to content

Instantly share code, notes, and snippets.

View tdamdouni's full-sized avatar

Taha Dhiaeddine Amdouni tdamdouni

View GitHub Profile
@tlinnet
tlinnet / .py
Created December 4, 2016 21:26
Pythonista, NSMutableURLRequest with a GET request. Using headers, parameters and ios basic authentication.
# python
from urlparse import urlparse
from urllib import urlencode
from ctypes import c_void_p
import json
import base64
# pythonista
import objc_util
@b00gizm
b00gizm / update_repo.py
Created November 20, 2016 16:53
Working with Git from iOS (Pythonista + Working Copy)
from collections import OrderedDict
import editor
import re
import sys
from urllib.parse import urlencode, quote
import webbrowser
key = "<YOUR KEY>"
def get_path():
@putztzu
putztzu / HowToOTGFast.md
Last active September 3, 2017 21:02 — forked from gbaman/HowToOTGFast.md
Simple guide for setting up OTG modes on the Raspberry Pi Zero, the fast way!

###Setting up Pi Zero OTG - The quick way (No USB keyboard, mouse, HDMI monitor needed)
More details - http://blog.gbaman.info/?p=791

For this method, alongside your Pi Zero, MicroUSB cable and MicroSD card, only an additional computer is required, which can be running Windows (with Bonjour, iTunes or Quicktime installed), Mac OS or Linux (with Avahi Daemon installed, for example Ubuntu has it built in).

If Avahi, Bonhjour or iTunes is blocked for unknown reasons, an alternative setup on Windows is to manually configure an IP address for the RPi using an unused network connection as described at the following link. Once configured, the device will automatically make its hostname available to the HostOS which is required to SSH to the RPi (SSH the IP address will not be authenticated properly) https://github.com/ev3dev/ev3dev/wiki/Setting-Up-Windows-USB-Ethernet-Networking#SettingIPAddress

1. Flash Raspbian Jessie f

@jsbain
jsbain / savefile.py
Last active March 1, 2019 07:51
savefile.py
#coding: utf-8
import requests
import appex,console,time,os
unquote=requests.utils.unquote
urlparse=requests.utils.urlparse
url=appex.get_url()
p=urlparse(url)
urlfilename=unquote(unquote(urlparse(appex.get_url()).path.split('/')[-1]))
console.hud_alert('downloading '+urlfilename)
"""
Use custom fonts in the editor
Usage: https://forum.omz-software.com/topic/3419/share-code-custom-editor-font
"""
__author__ = "Lukas Kollmer<[email protected]>"
__copyright__ = "Copyright (c) 2016 Lukas Kollmer<[email protected]>"
from objc_util import *
@dgelessus
dgelessus / pythonista_startup.py
Created August 10, 2016 16:47
pythonista_startup.py with enable_faulthandler
# This is an example pythonista_startup.py script.
# The code below is from https://github.com/dgelessus/pythonista_startup/blob/master/enable_faulthandler.py
from __future__ import absolute_import, division, print_function
def enable_faulthandler():
import ctypes
import datetime
import errno
import io
#######################################################
#### NOW AT A GITHUB REPO ####
#### https://github.com/tusing/unicorn_phat ####
#######################################################
#!/usr/bin/env python
# Display a list of user-defined color bars;
# fill the remaining area with sparkles.
# Designed for the Unicorn pHAT.
#!/usr/bin/env python
import paho.mqtt.client as mqtt
import RPi.GPIO as GPIO
def on_connect(client, userdata, rc):
#print ("Connected with rc: " + str(rc))
client.subscribe("kwf/demo/led")
def on_message(client, userdata, msg):
@KainokiKaede
KainokiKaede / DropboxSyncv2.py
Last active September 19, 2018 14:48 — forked from wrenoud/DropboxSync.py
DropboxSync
from __future__ import absolute_import
from __future__ import print_function
import os
import sys
import pickle
import console
import editor
import dropbox
# I moved 'dropboxlogin' into a sub folder so it doesn't clutter my main folder
@KainokiKaede
KainokiKaede / dropboxloginv2.py
Last active October 10, 2017 07:33 — forked from omz/dropboxlogin.py
dropboxlogin
# YOU NEED TO INSERT YOUR APP KEY AND SECRET BELOW!
# Go to dropbox.com/developers/apps to create an app.
from __future__ import absolute_import
from __future__ import print_function
app_key = 'YOUR_APP_KEY'
app_secret = 'YOUR_APP_SECRET'
import webbrowser
import dropbox