Skip to content

Instantly share code, notes, and snippets.

Avatar

Gabriel Jacoby-Cooper Gerzer

View GitHub Profile
View Spam Webex.applescript
activate application "Event Center"
tell application "System Events"
repeat 5 times
keystroke " "
key code 36
delay 1
end repeat
end tell
View Spam Discord.applescript
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
@Gerzer
Gerzer / valgrind.command
Last active Dec 9, 2020
Easily run Valgrind on a remote machine
View valgrind.command
#!/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/
@Gerzer
Gerzer / FTP sync.py
Last active Jan 18, 2018
Pythonista FTP sync
View FTP sync.py
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())
View Import File.py
# 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:
View Import URL.py
# 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:
View Snakeyes.py
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:')