Skip to content

Instantly share code, notes, and snippets.

Steven Troughton-Smith steventroughtonsmith

Block or report user

Report or block steventroughtonsmith

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@steventroughtonsmith
steventroughtonsmith / json
Created Aug 8, 2012
Using Twitter from ComputerCraft
View json
-----------------------------------------------------------------------------
-- JSON4Lua: JSON encoding / decoding support for the Lua language.
-- json Module.
-- Author: Craig Mason-Jones
-- Homepage: http://json.luaforge.net/
-- Version: 0.9.40
-- This module is released under the MIT License (MIT).
-- Please see LICENCE.txt for details.
--
-- USAGE:
@steventroughtonsmith
steventroughtonsmith / json
Created Aug 10, 2012
ComputerCraft Twitter Search
View json
-----------------------------------------------------------------------------
-- JSON4Lua: JSON encoding / decoding support for the Lua language.
-- json Module.
-- Author: Craig Mason-Jones
-- Homepage: http://json.luaforge.net/
-- Version: 0.9.40
-- This module is released under the MIT License (MIT).
-- Please see LICENCE.txt for details.
--
-- USAGE:
@steventroughtonsmith
steventroughtonsmith / stillalive-rpc8e.c
Created Aug 18, 2012
Still Alive written in C for the RPC8/e 65el02 CPU in Minecraft
View stillalive-rpc8e.c
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <peekpoke.h>
#include <time.h>
#include <unistd.h>
#include <fcntl.h>
@steventroughtonsmith
steventroughtonsmith / gist:6763213
Created Sep 30, 2013
Non-opaque application windows in iOS 7, with optional blur. Shows the user's wallpaper under the app, with Parallax if supported.
View gist:6763213
typedef enum _UIBackgroundStyle {
UIBackgroundStyleDefault,
UIBackgroundStyleTransparent,
UIBackgroundStyleLightBlur,
UIBackgroundStyleDarkBlur,
UIBackgroundStyleDarkTranslucent
} UIBackgroundStyle;
@interface UIApplication (UIBackgroundStyle)
-(void)_setBackgroundStyle:(UIBackgroundStyle)style;
@steventroughtonsmith
steventroughtonsmith / HWKViewController.m
Last active May 10, 2019
Example of dynamic iOS UI that changes based on the connection/disconnection of a hardware keyboard, based on suggestions from @JohnRHeaton. Requires linking to private GraphicsServices framework. rdar://problem/15447952
View HWKViewController.m
//
// HWKViewController.m
// HardwareKeyboardUI
//
// Created by Steven Troughton-Smith on 13/11/2013.
// Copyright (c) 2013 High Caffeine Content. All rights reserved.
//
#import "HWKViewController.h"
@steventroughtonsmith
steventroughtonsmith / gist:7515380
Last active Apr 2, 2019
iOS 7 UIKeyCommand keydown/keyup and keycode input implementation for a UIResponder. Private API, of course…
View gist:7515380
-(BOOL)canBecomeFirstResponder
{
return YES;
}
-(UIKeyCommand *)_keyCommandForEvent:(UIEvent *)event // UIPhysicalKeyboardEvent
{
NSLog(@"keyCommandForEvent: %@\n\
type = %i\n\
keycode = %@\n\
@steventroughtonsmith
steventroughtonsmith / ToonyPolymer.shader
Last active Mar 15, 2019
Toon-based plasticky Unity3D shader
View ToonyPolymer.shader
// Plasticky Unity3D shader
// Based on built-in Toon/Lighted
Shader "Custom/ToonyPolymer" {
Properties {
_Color ("Main Color", Color) = (0.5,0.5,0.5,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
_Ramp ("Toon Ramp (RGB)", 2D) = "gray" {}
_Shininess ("Shininess", Range (0.1, 1)) = 0.7
_Intensity ("Intensity", Range (0.1, 5.0)) = 1.0
View modlist
mods:
AM2_1.1.2b.zip
AdditionalPipes2.6.0-BC4.2.1.jar
AdvancedMachines_1.6.4.zip
AdvancedPowerManagement-1.2.85-IC2-1.118.jar
AnimationAPI v1.1.2 mc1.6.4.zip
ArchimedesShips.zip
Atomic-Science-1.1.0.49-core.jar
BetterDungeons207.zip
View modlist1.2
[mcp] Activating mod mcp
[FML] Activating mod FML
[Forge] Activating mod Forge
[CodeChickenCore] Activating mod CodeChickenCore
[Micdoodlecore] Activating mod Micdoodlecore
[MobiusCore] Activating mod MobiusCore
[NotEnoughItems] Activating mod NotEnoughItems
[PowerCrystalsCore] Activating mod PowerCrystalsCore
[TConstruct-Preloader] Activating mod TConstruct-Preloader
[AppliedEnergistics-Core] Activating mod AppliedEnergistics-Core
View gist:96da8fe10ecd70d104bc
@interface UIWindow (resize)
-(void)_adjustSizeClassesAndResizeWindowToFrame:(CGRect)frame;
@end
typedef enum _UICustomRes
{
UICustomResiPadTwoThirds,
UICustomResiPadHalf,
UICustomResiPadOneThird,
UICustomResiPhone47,
You can’t perform that action at this time.