Skip to content

Instantly share code, notes, and snippets.

View wgaylord's full-sized avatar

William Gaylord wgaylord

View GitHub Profile
@Shasoleosh
Shasoleosh / gmod_commands
Created March 31, 2020 12:24
All default gmod console commands
+alt1
+alt2
+attack
+attack2
+back
+break
+camdistance
+camin
+cammousemove
+camout
import logging
import requests
import lxml.html
import sys
sat = "40014" #SAT norrad_cat_id
transmitter = "NSXo8tGxmxpTUMsmSH34FF" #Transmitter UUID
start="2017-12-1 17:00" #Start date and time
end="2017-12-2 03:00" #Stop date and time
@Rawze
Rawze / ana_i2c_tinyslave.ino
Last active June 22, 2023 21:59
Arduino Attiny85 as 2-channel ana in + 1 chan pwm I2C slave device.
/*
ATtiny85 as 2-channel Analog + 1 PWM Output I2C Slave by Rawze. 05-16-2017
Default I2C adress = 0x04.
Program written and tested with ATTiny85 Arduino 8MHz internal clock bootloader.
Don't forget to select 8-Mhz internal clock and flash the bootloader on new hardware before first use.
@SpotlightKid
SpotlightKid / ImageFrame.py
Last active December 20, 2018 11:06
Remote-controllable digital image frame for iOS/Pythonista
#!python2
# -*- coding: utf-8 -*-
"""Remote-controllable digital image frame with built-in web server."""
import logging
import os
import re
import sys
import threading
import time
@lukaskollmer
lukaskollmer / get_available_memory.py
Last active October 2, 2023 11:41
Get memory stats in Pythonista using ctypes
#!/usr/bin/env python3
# Copyright (c) 2016 Lukas Kollmer<lukas@kollmer.me>
from ctypes import *
from objc_util import ObjCClass
NSProcessInfo = ObjCClass('NSProcessInfo')
NSByteCountFormatter = ObjCClass('NSByteCountFormatter')
@steventroughtonsmith
steventroughtonsmith / main.m
Created March 24, 2016 08:08
Load Mach-O executable at runtime and execute its entry point
void callEntryPointOfImage(char *path, int argc, char **argv)
{
void *handle;
int (*binary_main)(int binary_argc, char **binary_argv);
char *error;
int err = 0;
printf("Loading %s\n", path);
handle = dlopen (path, RTLD_LAZY);
@omz
omz / Spellcheck word.py
Created March 10, 2016 20:01
Spellcheck word.py
# coding: utf-8
from objc_util import ObjCClass
UITextChecker = ObjCClass('UITextChecker')
def check_word(word, lang='en_US'):
c = UITextChecker.new().autorelease()
check = c.rangeOfMisspelledWordInString_range_startingAt_wrap_language_
misspelled_range = check(word, (0, len(word)), 0, False, lang)
return (misspelled_range.location != 0)
@omz
omz / EmbedPyui.py
Last active December 21, 2021 21:17
EmbedPyui.py
# coding: utf-8
'''
This is a little helper script to make it easier
to create single-file scripts with Pythonista, while
still taking advantage of the UI editor.
It'll essentially convert the .pyui file to a compact
string representation that you can embed directly
in your script. The code to unpack and load the UI
is also auto-generated for convenience.
@omz
omz / Height map 1.py
Created February 29, 2016 19:15
Height map 1.py
# coding: utf-8
# Optimized version of the code in this forum post: https://forum.omz-software.com/topic/2850/2-problems-with-shape-nodes-and-sprite-nodes
from scene import *
import random
import ui
import math
def render_bottom_texture(width=100.0):
@omz
omz / Barcode Scanner.py
Created February 19, 2016 00:36
Barcode Scanner.py
# coding: utf-8
# Barcode scanner demo for Pythonista
# Based on http://www.infragistics.com/community/blogs/torrey-betts/archive/2013/10/10/scanning-barcodes-with-ios-7-objective-c.aspx
from objc_util import *
from ctypes import c_void_p
import ui
import sound
found_codes = set()