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
activate application "Event Center" | |
tell application "System Events" | |
repeat 5 times | |
keystroke " " | |
key code 36 | |
delay 1 | |
end repeat | |
end tell |
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
activate application "Discord" | |
repeat 5 times | |
tell application "System Events" | |
repeat 10 times | |
keystroke "." | |
key code 36 using shift down | |
end repeat | |
key code 36 | |
delay 1 | |
end tell |
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
#!/bin/bash | |
user="" # Server user | |
address="" # Server address | |
ssh $user@$address << ENDSSH | |
cd ~/ | |
mkdir valgrind/ | |
ENDSSH | |
scp *.cpp $user@$address:~/valgrind/ | |
scp *.h $user@$address:~/valgrind/ |
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 ui | |
import console | |
import keychain | |
import ftplib | |
import os | |
import re | |
import time | |
from datetime import datetime | |
global cur_dir | |
cur_dir = os.path.abspath(os.getcwd()) |
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
# coding: utf-8 | |
import appex | |
import os | |
import shutil | |
def main(): | |
if not appex.is_running_extension(): | |
print 'ERROR: This script is meant to be run from the sharing extension.' | |
else: |
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
# coding: utf-8 | |
import appex | |
import requests | |
def main(): | |
if not appex.is_running_extension(): | |
print 'Running in Pythonista app, using test data...\n' | |
url = 'http://example.com' | |
else: |
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 editor | |
full_text = editor.get_text() | |
cursor = editor.get_selection()[1] | |
while True: | |
try: | |
if full_text[cursor - 3] + full_text[cursor - 2] + full_text[cursor - 1] == 'def': | |
editor.replace_text(cursor, cursor, ' func_name():') | |
editor.set_selection(cursor + 1, cursor + 10) | |
if full_text[cursor - 3] + full_text[cursor - 2] + full_text[cursor - 1] == 'ifc': | |
editor.replace_text(cursor, cursor, ' condition:') |