Skip to content

Instantly share code, notes, and snippets.

View Gerzer's full-sized avatar

Gabriel Jacoby-Cooper Gerzer

  • Rensselaer Polytechnic Institute
  • Troy, NY
  • 23:03 (UTC -04:00)
  • X @GerzerSoftware
View GitHub Profile
@Gerzer
Gerzer / Snakeyes.py
Created June 20, 2014 20:51
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:')
@Gerzer
Gerzer / Import URL.py
Created June 27, 2015 14:52
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:
@Gerzer
Gerzer / Import File.py
Created June 27, 2015 15:00
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:
@Gerzer
Gerzer / FTP sync.py
Last active January 18, 2018 23:42
Pythonista FTP sync
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())
@Gerzer
Gerzer / valgrind.command
Last active December 9, 2020 23:54
Easily run Valgrind on a remote machine
#!/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/
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 / Spam Webex.applescript
Created October 23, 2020 19:18
Webex Spammer
activate application "Event Center"
tell application "System Events"
repeat 5 times
keystroke " "
key code 36
delay 1
end repeat
end tell