Skip to content

Instantly share code, notes, and snippets.

View alessaba's full-sized avatar

Alessandro Saba alessaba

  • 20:59 (UTC +02:00)
View GitHub Profile
# On branch master
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
#21modified: index.php
# modified: wp-config.php
# modified: wp-content/plugins/advanced-custom-fields/core/controllers/options_page.php
# modified: wp-content/plugins/advanced-custom-fields/core/controllers/settings.php
# modified: wp-content/plugins/advanced-custom-fields/core/fields/page_link.php
# File Transfer for Pythonista
# ============================
# This script allows you to transfer Python files from
# and to Pythonista via local Wifi.
# It starts a basic HTTP server that you can access
# as a web page from your browser.
# When you upload a file that already exists, it is
# renamed automatically.
# From Pythonista's settings, you can add this script
# to the actions menu of the editor for quick access.
import os, os.path, sys, urllib2, requests
class PyPiError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
def _chunk_report(bytes_so_far, chunk_size, total_size):
if (total_size != None):
import urllib2, urlparse, sys, webbrowser
itags = {'45': 'webm_720p',
'44': 'webm_480p',
'43': 'webm_360p',
'38': 'mp4_3072p',
'37': 'mp4_1080p',
'36': 'phone_mp4_240p',
'35': 'flv_480p',
'34': 'flv_360p',
@alessaba
alessaba / gist:6173177
Last active December 20, 2015 18:08 — forked from jwt2d/gist:6120070
# Launcher
#
# A Simple Launcher in Notification Center
from scene import *
import webbrowser,console,notification
#----------Launcher Settings---------------
key_names = [[['GChrome','googlechrome:'],
['Keeper','keeper:']],
[['Calculator','calculatorinfinity:']],
@alessaba
alessaba / prowl_reciever.py
Last active December 20, 2015 22:28
prowl_reciever
import clipboard,sys
#you have to set Prowl's custom url to 'pythonista://prowl_reciever?action=run&args=hello%20world' where 'hello%20world is the notification text.
#I'll use argv to take advantage of the Pythonista's URL Scheme.
text=str(sys.argv[1]).replace('[space]',' ') #the [space] is a space
clipboard.set('')
clipboard.set(text)
print text #Remove after debug
@alessaba
alessaba / prowl_sender.py
Last active December 20, 2015 22:28
prowl_sender
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#Sender (for Mac OS X)
# For details, in Mac OS X Terminal type: man pbcopy
import subprocess, sys
import prowlpy
def getClipboardData(): # Only works for data types: {txt | rtf | ps}
p = subprocess.Popen(['pbpaste'], stdout=subprocess.PIPE)
typedef enum _UIBackgroundStyle {
UIBackgroundStyleDefault,
UIBackgroundStyleTransparent,
UIBackgroundStyleLightBlur,
UIBackgroundStyleDarkBlur,
UIBackgroundStyleDarkTranslucent
} UIBackgroundStyle;
@interface UIApplication (UIBackgroundStyle)
-(void)_setBackgroundStyle:(UIBackgroundStyle)style;
@alessaba
alessaba / PythonistaMod.py
Created July 29, 2015 11:45
PythonistaMod.py
# coding: utf-8
from objc_util import *
import ui
@on_main_thread
def main():
app=ObjCClass('UIApplication').sharedApplication() #Si accede all app in se
root_vc=app.keyWindow().rootViewController() #si accede alla view di base
mainView=root_vc.detailViewController().view() #Si acccede alla view principale
@alessaba
alessaba / TouchID.py
Last active October 27, 2021 03:53
TouchID.py
# coding: utf-8
from objc_util import *
ObjCClass('NSBundle').bundleWithPath_('/System/Library/Frameworks/LocalAuthentication.framework').load()
context = ObjCClass('LAContext').alloc().init()
policy = 1 #put 1 if you want to auth with password, 2 with passcode
reason = 'We need you fingerprint to ste...ehm... to log you in'
def funct(_cmd,success,error):
if success: