Skip to content

Instantly share code, notes, and snippets.

@vicro
vicro / gist:98deb3c16c81721862134aa2f602e69e
Created October 29, 2023 06:02 — forked from noonat/gist:1649543
Rake Quick Reference
# Rake Quick Reference
# by Greg Houston
# http://ghouston.blogspot.com/2008/07/rake-quick-reference.html
# -----------------------------------------------------------------------------
# Running Rake
# -----------------------------------------------------------------------------
# running rake from the command-line:
# rake --help
using System.Collections.Generic;
using System.IO;
using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
// This is only useful for spritesheets that need to be automatically sliced (Sprite Editor > Slice > Automatic)
public class AutoSpriteSlicer
{
[MenuItem("Tools/Slice Spritesheets %&s")]
@vicro
vicro / gist:986a6ccfc791fc323d70963c6a7cd450
Created May 8, 2018 02:39
C# disable the "Field is never assigned to..." warning sample
// Disable "Field is never assigned to..." compiler's warning. Justification: the field is assigned by MEF.
#pragma warning disable CS0649
/// <summary>
/// Classification registry to be used for getting a reference
/// to the custom classification type later.
/// </summary>
[Import]
private IClassificationTypeRegistryService classificationRegistry;
@vicro
vicro / build.sh
Created July 30, 2017 18:12 — forked from jonah-williams/build.sh
Command line iOS project builds and over-the-air distribution
#!/bin/bash
# https://gist.github.com/949831
# http://blog.carbonfive.com/2011/05/04/automated-ad-hoc-builds-using-xcode-4/
# command line OTA distribution references and examples
# http://nachbaur.com/blog/how-to-automate-your-iphone-app-builds-with-hudson
# http://nachbaur.com/blog/building-ios-apps-for-over-the-air-adhoc-distribution
# http://blog.octo.com/en/automating-over-the-air-deployment-for-iphone/
# http://www.neat.io/posts/2010/10/27/automated-ota-ios-app-distribution.html
@vicro
vicro / GetterSetterSample.cpp
Last active January 28, 2020 20:55
Getter and Setter example in c++11
// Example program
#include <iostream>
#include <string>
/*
Getter and setter functor object.
T Value type
Owner Type of owner class
get_function Owner's getter function type
@vicro
vicro / excel_vba_quick_ref.bas
Last active November 18, 2016 02:03
Quick ref for Excel Macros
' ------------------------------------------------------------------------------
' Quick ref for Excel Macros
' ------------------------------------------------------------------------------
' for loops
Dim i as Integer
For i = 0 To 10
' Basic ranged loop
Next i
@vicro
vicro / python_regex_quickref.py
Last active November 10, 2016 02:30
Python REGEX quick ref
#import regex module
import re
#Simple match of a phone number 090-1234-5678
print("####### Simple match of a phone number 090-1234-5678 #######")
match = re.match( r"\d{3}-\d{4}-\d{4}", "090-1234-5678" )
print(match)
#No match
print("####### No match #######")
@vicro
vicro / gist:5829162
Last active February 16, 2024 07:23
Retina Display for CreateJS
var canvas, stage, exportRoot;
function init() {
canvas = document.getElementById("canvas");
//Setup the canvas widht and height with devicePixelRatio. And set CSS width and height properties.
var w = 320;
var h = 357;
canvas.width = w * window.devicePixelRatio;
canvas.height = h * window.devicePixelRatio;
@vicro
vicro / firegesture_rikaichan.js
Created June 14, 2012 08:23
Toggle rikaichan with FireGestures
/*
* Send the keystroke for toggling
* Rikaichan
*/
var event = document.createEvent("KeyboardEvent");
event.initKeyEvent(
"keypress", //Key code
true, // in boolean canBubbleArg,
true, // in boolean cancelableArg,