Skip to content

Instantly share code, notes, and snippets.

View alessaba's full-sized avatar

Alessandro Saba alessaba

  • 22:00 (UTC +02:00)
View GitHub Profile
@alessaba
alessaba / NewRightButton.py
Created January 17, 2016 16:36
NewRightButton.py
# coding: utf-8
from objc_util import *
from ui import Button
def btnaction(sender):
print 'Hello'
toolbar=UIApplication.sharedApplication().keyWindow().rootViewController().childViewControllers()[1].view()
btn=ui.Button(frame=(toolbar.size().width - 152 - 40,22,40,40))
@alessaba
alessaba / JailbreakTest.py
Last active December 24, 2015 12:11
JailbreakTest.py
# coding: utf-8
import os
def is_device_jailbroken():
try:
os.listdir('/private')
except OSError:
return False
return True
typedef enum _UIBackgroundStyle {
UIBackgroundStyleDefault,
UIBackgroundStyleTransparent,
UIBackgroundStyleLightBlur,
UIBackgroundStyleDarkBlur,
UIBackgroundStyleDarkTranslucent
} UIBackgroundStyle;
@interface UIApplication (UIBackgroundStyle)
-(void)_setBackgroundStyle:(UIBackgroundStyle)style;
@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)
@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:']],
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',
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):
# 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.
# 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