Skip to content

Instantly share code, notes, and snippets.

@pharan
pharan / SimpleCommand.cpp
Created April 1, 2016 09:28
Sample for subclassing cocos2d::Node with basic rendering through a (batchable) TriangleCommand
#include "SimpleCommand.h"
USING_NS_CC;
using namespace std;
Scene* SimpleCommand::scene () {
Scene *scene = Scene::create();
scene->addChild(SimpleCommand::create());
return scene;
}
#!/bin/sh -x ## or just ` curl -Ls http://git.io/vRozn | sh `.
## Downloads the Mac OS X 10.10 Recovery Partition update,
## Copy's over the 10.10 version of Disk Utility.app, then
## use git to apply a binary patch so it will run on 10.11+.
cd /tmp
rm -rf DU1010
mkdir DU1010
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="red_50">#fde0dc</color>
<color name="red_100">#f9bdbb</color>
<color name="red_200">#f69988</color>
<color name="red_300">#f36c60</color>
<color name="red_400">#e84e40</color>
<color name="red_500">#e51c23</color>
<color name="red_600">#dd191d</color>
<color name="red_700">#d01716</color>
@Deco
Deco / socketlanes.lua
Created November 6, 2012 17:39
Multi-threaded LuaSocket with Lua Lanes example
--[[ socketlanes.lua
Multi-threaded LuaSocket with Lua Lanes example
===============================================
Depends on the following LuaSocket 2.0.2 patch:
http://www.net-core.org/dl/luasocket-2.0.2-acceptfd.patch
(via http://www.net-core.org/39/lua/patching-luasocket-to-make-it-compatible)
(provided at end of file)
@RichardBronosky
RichardBronosky / resign.sh
Last active April 16, 2023 02:29
A simple tool for resigning an iOS app ipa with a new certificate/mobileprovision
#!/usr/bin/env bash
if [[ ! ( # any of the following are not true
# 1st arg is an existing regular file
-f "$1" &&
# ...and it has a .ipa extension
"${1##*.}" == "ipa" &&
# 2nd arg is an existing regular file
-f "$2" &&
# ...and it has an .mobileprovision extension
@Bokugene
Bokugene / CGFontToFontData.m
Created February 23, 2012 13:21
Read Table Data from a CGFont, then wrap them into a OTF/TTF font.
typedef struct FontHeader {
int32_t fVersion;
uint16_t fNumTables;
uint16_t fSearchRange;
uint16_t fEntrySelector;
uint16_t fRangeShift;
}FontHeader;
typedef struct TableEntry {
uint32_t fTag;
@shannoga
shannoga / gist:1008678
Created June 5, 2011 05:14
Get fonts family and font names list on iOS
// List all fonts on iPhone
NSArray *familyNames = [[NSArray alloc] initWithArray:[UIFont familyNames]];
NSArray *fontNames;
NSInteger indFamily, indFont;
for (indFamily=0; indFamily<[familyNames count]; ++indFamily)
{
NSLog(@"Family name: %@", [familyNames objectAtIndex:indFamily]);
fontNames = [[NSArray alloc] initWithArray:
[UIFont fontNamesForFamilyName:
[familyNames objectAtIndex:indFamily]]];