Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@raresloth
raresloth / key_flip_x.rb
Created June 9, 2015 18:52
Spine animation script that keys the flipX key at time 0 for all animations ending in "_west"
#!/usr/bin/env ruby
require 'json'
if ARGV.count != 1
puts '[usage] ./key_flips_x.rb exported_skeleton.json'
raise RuntimeError
end
file_path = ARGV[0]
@raresloth
raresloth / LocalizedScreenshotTest.m
Last active March 19, 2016 20:45
A cocos2d-objc method to save localized screenshot images
/**
* This assumes the test is being run on an iPad Pro (or simulator) so the largest screenshot
* doesn't get clipped. Base images with no text should be provided in the test resources with the -ipadhd extension.
* The output will be images in localized subfolders within the Documents folder of the simulator's sandbox.
*
* Run this method in any CCScene or full screen CCNode
*/
- (void)screenGrabAppStoreImages
{
// Our blank images are named "3.5_00-ipadhd.png", "3.5_01-ipadhd.png", "4_00-ipadhd.png", etc.
@raresloth
raresloth / import_controller.rb
Last active October 1, 2017 16:13
Quick setup for importing a csv on a Rails server
def import_csv
if params[:file]
ImportHelper.import_csv(params[:file])
end
end
@raresloth
raresloth / randomBenchmark.js
Created December 27, 2018 21:21
A benchmark test for finding a random record using nodejs and mongoose
const mongoose = require('mongoose'),
Benchmark = require('benchmark'),
Promise = require('bluebird')
mongoose.connect('mongodb://localhost:27017/sandbox', {useNewUrlParser: true})
const Model = mongoose.model('Model', new mongoose.Schema({
name: String
}))
@raresloth
raresloth / FURBroadcaster.h
Created October 14, 2017 15:55
ReplayKit recorder and broadcaster classes used in King Rabbit
//
// FURBroadcaster.h
// furdemption
//
// Created by Austin Borden on 10/8/16.
// Copyright © 2016 RareSloth LLC. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <ReplayKit/ReplayKit.h>
@raresloth
raresloth / Example.cs
Last active April 23, 2022 06:29
Extension methods for MonoBehaviour that make it easy to schedule a block of code at a given time in Unity
// Runs the block of code at the end of the 10th FixedUpdate from now
myScript.InFixedUpdates(10, delegate
{
DoSomething();
DoSomethingElse();
});