Skip to content

Instantly share code, notes, and snippets.

View tjferry14's full-sized avatar

TJ Ferry tjferry14

View GitHub Profile
@mackuba
mackuba / wwdc16.md
Last active March 5, 2023 21:28
New stuff from WWDC 2016

Following the tradition from last year, here's my complete list of all interesting features and updates I could find in Apple's OSes, SDKs and developer tools that were announced at this year's WWDC. This is based on the keynotes, the "What's New In ..." presentations and some others, Apple's release notes, and blog posts and tweets that I came across in the last few weeks.

If for some reason you haven't watched the talks yet, I really recommend watching at least the "State of the Union" and the "What's New In" intros for the platforms you're interested in. The unofficial WWDC Mac app is great way to download the videos and keep track of what you've already watched.

If you're interested, here are my WWDC 2015 notes (might be useful if you're planning to drop support for iOS 8 now and start using some iOS 9 APIs).


OSX → macOS 10.12 Sierra

@omz
omz / Audio Recorder.py
Created February 3, 2015 00:07
Audio Recorder.py
from ctypes import c_void_p, c_char_p, c_double, c_float, c_int, cdll, util, c_bool
import os
import time
# Load Objective-C runtime:
objc = cdll.LoadLibrary(util.find_library('objc'))
objc.sel_getName.restype = c_char_p
objc.sel_getName.argtypes = [c_void_p]
objc.sel_registerName.restype = c_void_p
objc.sel_registerName.argtypes = [c_char_p]
@pruppert
pruppert / WeMo.py
Last active June 23, 2023 08:57
This is a python script that can control a local WeMo switch as long as you know the local IP of the WeMo. The script is a fork of pdumoulin's blinky: https://github.com/pdumoulin/blinky.
#!/usr/bin/python
import re
import urllib2
# Configuration:
# Enter the local IP address of your WeMo in the parentheses of the ip variable below.
# You may have to check your router to see what local IP is assigned to the WeMo.
# It is recommended that you assign a static local IP to the WeMo to ensure the WeMo is always at that address.
# Uncomment one of the triggers at the end of this script.
@henryiii
henryiii / cards.py
Last active October 13, 2022 01:18
base for card games
# -*- coding: utf-8 -*-
"""
Created on Sun Jul 20 17:27:33 2014
@author: henryiii
"""
# http://en.wikipedia.org/wiki/Playing_cards_in_Unicode
from __future__ import unicode_literals, division
@henryiii
henryiii / h2048.py
Last active January 17, 2022 07:06
Pythonista 2048 clone, using ui module. Also should work in any Python console. Added jsbain's swipe implementation.
# -*- coding: utf-8 -*-
"""
Created on Sat Jul 12 09:33:29 2014
@author: henryiii
Added improvents by JonB (swipes), techteej (design), LawAbidingCactus (size)
"""
import console, random
@jsbain
jsbain / gistcheck.py
Last active November 24, 2022 00:18 — forked from davenicholls/gistcheck.py
updated comment: prevent opening of pyui in editor
# Source: https://gist.github.com/5212628
#
# All-purpose gist tool for Pythonista.
#
# When run directly, this script sets up four other scripts that call various
# functions within this file. Each of these sub-scripts are meant for use as
# action menu items. They are:
#
# Set Gist ID.py - Set the gist id that the current file should be
# associated with.
@SebastianJarsve
SebastianJarsve / MazeCreator.py
Last active August 29, 2015 13:56
Maze Creator
from scene import *
from random import choice
def opposite(d):
return (d[0]*-1, d[1]*-1)
def sub_tuples(a, b):
return (a[0]-b[0], a[1]-b[1])
def add_tuples(a, b):
from scene import *
from random import randint
screen_size = Size()
class Ball (object):
def __init__(self, pos=None, size=Size(70, 70), c=(1,0,0)):
load_image('White_Circle')
if pos is None:
pos = Point(randint(0, screen_size.w), randint(0, screen_size.h))
@cclauss
cclauss / draggableImages.py
Last active December 16, 2015 04:49
draggableImages demo for Pythonista on iOS.
# http://omz-forums.appspot.com/pythonista/post/5144563366756352
import random, scene
sizeInPixels = 100
def rectFromPt(inPoint): # returns a scene.Rect centered on inPoint
half = sizeInPixels / 2
return scene.Rect(inPoint.x - half, inPoint.y - half, sizeInPixels, sizeInPixels)
@omz
omz / ImageMail.py
Created November 14, 2012 17:43
ImageMail
# Example for sending an email with an attached image using smtplib
#
# IMPORTANT: You need to enter your email login in the main() function.
# The example is prepared for GMail, but other providers
# should be possible by changing the mail server.
import smtplib
from email.mime.base import MIMEBase
from email.mime.multipart import MIMEMultipart
from email import encoders