Skip to content

Instantly share code, notes, and snippets.

@hofmannsven
hofmannsven / README.md
Last active October 2, 2025 20:17
Git CLI Cheatsheet
@puttin
puttin / README.md
Last active December 22, 2015 23:29
Some tools may possibly help you to watch WWDC 2013 videos.

Where Is The Name?

Be careful before you use these tools.

#What's this? what's this?

Some tools may possibly help you to watch WWDC 2013 videos.

@steipete
steipete / PSPDFUIKitMainThreadGuard.m
Last active May 27, 2024 12:11
This is a guard that tracks down UIKit access on threads other than main. This snippet is taken from the commercial iOS PDF framework http://pspdfkit.com, but relicensed under MIT. Works because a lot of calls internally call setNeedsDisplay or setNeedsLayout. Won't catch everything, but it's very lightweight and usually does the job.You might n…
// Taken from the commercial iOS PDF framework http://pspdfkit.com.
// Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved.
// Licensed under MIT (http://opensource.org/licenses/MIT)
//
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it.
// PLEASE DUPE rdar://27192338 (https://openradar.appspot.com/27192338) if you would like to see this in UIKit.
#import <objc/runtime.h>
#import <objc/message.h>
@zrxq
zrxq / gist:5363610
Last active February 3, 2016 15:35
CGRect inset with UIEdgeInsets
inline static CGRect CGRectEdgeInset(CGRect rect, UIEdgeInsets insets) {
return CGRectMake(CGRectGetMinX(rect)+insets.left, CGRectGetMinY(rect)+insets.top, CGRectGetWidth(rect)-insets.left-insets.right, CGRectGetHeight(rect)-insets.top-insets.bottom);
}
@mayoff
mayoff / makeAnimatedGif.m
Created February 16, 2013 23:00
Example of creating an animated GIF on iOS, with no 3rd-party code required. This should also be easy to port to OS X.
#import <UIKit/UIKit.h>
#import <ImageIO/ImageIO.h>
#import <MobileCoreServices/MobileCoreServices.h>
static UIImage *frameImage(CGSize size, CGFloat radians) {
UIGraphicsBeginImageContextWithOptions(size, YES, 1); {
[[UIColor whiteColor] setFill];
UIRectFill(CGRectInfinite);
CGContextRef gc = UIGraphicsGetCurrentContext();
CGContextTranslateCTM(gc, size.width / 2, size.height / 2);
@rclabs
rclabs / youtube2xbmc.js
Created January 18, 2013 11:38
youtube to xbmc using node.js
// based on
// xbmc api example http://userscripts.org/scripts/review/117046
// node.js example code http://nodejs.org/api/http.html#http_http_request_options_callback
var http = require('http');
var options = {
hostname: '192.168.1.100',
port: 80,
path: '/jsonrpc',
anonymous
anonymous / gist:4555828
Created January 17, 2013 13:06
Download Veneer Font Family
Download Veneer Font Family
Veneer from Yellow Design Studio is a high resolution hand-crafted letterpress font that’s vintage and authentic with a touch of grunge. It’s highly customizable with six distress options for every letter and three for all other characters, and because it’s remarkably detailed, it looks great even at very large sizes.
The Veneer family includes Veneer, Veneer Two, and Veneer Three with Veneer containing the least distressed characters and Veneer Three the most. Mix and match as desired to create realistic letterpress type.
Download Link :
http://rapidshare.com/files/2194949428/Veneer.Font.Family.rar
@sivartydrup
sivartydrup / IOBOT v1.2
Created January 17, 2013 12:23
Next iteration
var Robot = function(robot) {
robot.rotateCannon(90);
};
Robot.prototype.onIdle = function(ev) {
ev.robot.clone();
if (ev.robot.parentId !== null) {
ev.robot.turn(-90);
ev.robot.rotateCannon(3);
@dblooman
dblooman / gist:4555565
Created January 17, 2013 12:17
image
curl http://localhost:3000/?url=m.live.bbc.co.uk/news\&width=320\&userAgent=font-exclude\&delay=2000\ > bbc1L.png
curl http://localhost:3000/?url=http://dave-sandbox.t.proxylocal.com/news\&width=320\&userAgent=font-exclude\&delay=2000\ > bbc1.png
node imagediff [-d|diff] bbc1.png bbc1L.png diff1.png
@tuttlem
tuttlem / texture.cpp
Created January 5, 2013 07:00
texture class load
SDL_Surface *surface = NULL;
if ((surface = IMG_Load(filename.c_str()))) {
_colours = surface->format->BytesPerPixel;
// get the image format
if (_colours == 4) {
if (surface->format->Rmask == 0x000000ff) {
_format = GL_RGBA;
} else {