Skip to content

Instantly share code, notes, and snippets.

@epologee
epologee / NSBundle+TTTOverrideLanguage.h
Created October 11, 2013 19:26
Use method swizzling to change both language and locale at runtime, to use in your unit tests.
#import <Foundation/Foundation.h>
@interface NSBundle (TTTOverrideLanguage)
+ (void)ttt_overrideLanguage:(NSString *)language;
+ (void)ttt_resetLanguage;
@end
@brandonpittman
brandonpittman / Finder_Deselect.applescript
Created September 6, 2013 16:52
An AppleScript to deselect the selection in Finder.app. Run it with ⌘⇧A with Keyboard Maestro or FastScripts.
tell application "Finder"
try
if get selection is not {} then set selection to {}
end try
end tell
@Shilo
Shilo / NSString+Reverse.h
Last active April 24, 2018 18:44
A category for NSString to reverse string.
//
// NSString+Reverse.h
//
// Created by Shilo White on 9/1/13.
// Copyright (c) 2013 Shilocity Productions. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSString (Reverse)
@eternalstorms
eternalstorms / Apple Evangelists.txt
Created June 12, 2013 09:07
Apple Evangelists (WWDC 2013)
UI- and App Frameworks Evangelist - Jake Behrens, [email protected], twitter: @Behrens
- What's new in Cocoa
- Accessibility in iOS
- Building User Interfaces for iOS 7
- Getting Started with UIKit Dynamics
- What's new in Cocoa Touch
- What's New With Multitasking
- Best Practices for Cocoa Animation
- Improving Power Efficiency with App Nap
- Introducing Text Kit
@dvalentino
dvalentino / turtle.py
Created May 4, 2013 22:57
Simple Turtle Class for Pythonista (iOS)
# -*- coding: utf-8 -*-
#
# turtle.py - Turtle Class for Pythonista
#
# When run as a script, the following are demonstrated:
# (a) multiple turtle instances illustrate turtle behaviors
# (b) the classic Koch snowflake is drawn
#
# History:
# 13-Apr-2013 DJValentino created Turtle Class
@cclauss
cclauss / tabsTo4Spaces.py
Created April 22, 2013 14:55
Simple Pythonista utility script that you need to put this Pythonista Actions menu. It goes though the script currently open in the Pythonista Editor, converting all tab characters ('\t') into four space characters.
# replace ALL tab characters with four spaces
import editor, sys
theText = editor.get_text()
theCount = theText.count('\t')
if not theText.count('\t'):
print('no tabs found.')
sys.exit()
theLength = len(theText)
import sys
import subprocess
import tempfile
import urllib
text = sys.stdin.read()
chart_url_template = ('http://chart.apis.google.com/chart?'
'cht=qr&chs=300x300&chl={data}&chld=H|0')
chart_url = chart_url_template.format(data=urllib.quote(text))
@spencerogden
spencerogden / gistcheck.py
Last active August 8, 2023 14:43 — forked from Westacular/gistcheck.py
Script for use with Pythonista to allow Github Gists for script storage and retrieval. Copy script in full into a new script in Pythonista called "gitcheck". Run the script and it will create 4 scripts starting with "Gist". These can be added to the action menu. See comments for more details.
# Source: https://gist.github.com/4702275
#
# 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.
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 1, 2025 01:48
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@omz
omz / turtle.py
Created December 30, 2012 17:04
turtle
# turtle.py
# Basic Turtle graphics module for Pythonista
#
# When run as a script, the classic Koch snowflake is drawn as a demo.
# The module can also be used interactively or from other scripts:
# >>> from turtle import *
# >>> right(30)
# >>> forward(100)
# ...