This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import contacts | |
import webbrowser, urllib | |
from seamless_dropbox import open | |
import console | |
DRAFTS_ACTION = "Backup Contacts" | |
VCARD = "" | |
people = contacts.get_all_people() | |
i = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_doing() | |
{ | |
local cur=${COMP_WORDS[COMP_CWORD]} | |
COMPREPLY=( $(compgen -W "$(doing help -c)" -- $cur) ) | |
} | |
complete -F _doing doing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib | |
a=['<','<','<','<'] | |
[ (lambda a:lambda t,v:a(t,a,v))(lambda t,s,x:t if x==0 else s(urllib.quote(t),s,x-1))(x,idx+1) for idx,x in enumerate(a) ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# wol.py | |
import socket | |
import struct | |
def wake_on_lan(macaddress): | |
""" Switches on remote computers using WOL. """ | |
# Check macaddress format and try to compensate. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
from sys import argv | |
from time import strftime | |
from math import floor | |
clocks = {'12:00': '🕛', '12:30': '🕧', '1:00': '🕐', '1:30': '🕜', | |
'2:00': '🕑', '2:30': '🕝', '3:00': '🕒', '3:30': '🕞', | |
'4:00': '🕓', '4:30': '🕟', '5:00': '🕔', '5:30': '🕠', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import re | |
with open("/home/fxcrespo/workspaces/workspace_siga/count.log", "w") as thelog: | |
for path, dirs, files in os.walk("/home/fxcrespo/workspaces/workspace_siga"): | |
for thefile in files: | |
thepath = os.path.join(path, thefile) | |
if thepath.endswith("jsp"): | |
thecount = len(re.findall("\"", "".join(open(thepath).readlines()))) | |
if thecount > 0 and (thecount % 2 != 0): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import webbrowser, os, pprint | |
# Include the Dropbox SDK libraries | |
#from dropbox import client, rest, session | |
import dropbox | |
# Configuration | |
TOKEN_FILENAME = 'PythonistaDropbox.token' | |
# Get your app key and secret from the Dropbox developer website | |
APP_KEY = '<your dropbox app_key>' | |
APP_SECRET = '<your dropbox app_secret>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init]; | |
picker.messageComposeDelegate = self; | |
picker.recipients = [NSArray arrayWithObject:@"48151623"]; | |
picker.body = @"Body text."; | |
[self presentModalViewController:picker animated:YES]; | |
[picker release]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on run {input, parameters} | |
using terms from application "Finder" | |
set filepath to POSIX path of input | |
do shell script "open '" & filepath & "'" with administrator privileges | |
end using terms from | |
end run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
USER_TOKEN = u'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' #replace with your user key | |
APP_TOKEN = u'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' #replace with your APP token/key | |
HEADERS = { "Content-type": "application/x-www-form-urlencoded" } | |
def sendPush(message, title, url, url_title): | |
parameters = { u'token': APP_TOKEN, | |
u'user': USER_TOKEN, |
OlderNewer