Skip to content

Instantly share code, notes, and snippets.

@SiarheiPilat
SiarheiPilat / ReplaceWithPrefab.cs
Last active September 20, 2022 23:01 — forked from unity3dcollege/ReplaceWithPrefab.cs
Updated for the latest API. Accounts for original prefabs and variants.
using UnityEngine;
using UnityEditor;
/// Taken from: https://gist.github.com/SiarheiPilat/05463e64d4662860c6a799bb23d9aec8
/// Forked from: https://gist.github.com/unity3dcollege/c1efea3f87d3775bee3e010e9c6d7648
/// Author: Siarhei Pilat (Suasor AB)
/// License: MIT
public class ReplaceWithPrefab : EditorWindow
{
@wcoastsands
wcoastsands / DisableUpdateNotice.cs
Last active June 26, 2017 19:54
Disable IAP Updater
using UnityEditor;
namespace UnityEngine.Purchasing
{
public class DisableUpdateNotice
{
[MenuItem("Window/Unity IAP/Ignore Updates (30 days)", false, 0)]
static void DoDisableUpdateNotice()
{
PlayerPrefs.SetString("PackageUpdaterLastChecked68207", System.DateTime.UtcNow.AddDays(30).ToString());
#if NETFX_CORE // Workaround to support changes in the .Net reflection API for Windows Store Apps
using System;
using System.Reflection;
namespace UnityEngine.Analytics.Experimental.Tracker
{
public static class TypeExtensions
{
public static PropertyInfo GetProperty(this Type type, string propertyName)
@alexeygrigorev
alexeygrigorev / vimeo-download.py
Created September 17, 2016 09:09
Downloading segmented video from vimeo
import requests
import base64
from tqdm import tqdm
master_json_url = 'https://178skyfiregce-a.akamaihd.net/exp=1474107106~acl=%2F142089577%2F%2A~hmac=0d9becc441fc5385462d53bf59cf019c0184690862f49b414e9a2f1c5bafbe0d/142089577/video/426274424,426274425,426274423,426274422/master.json?base64_init=1'
base_url = master_json_url[:master_json_url.rfind('/', 0, -26) + 1]
resp = requests.get(master_json_url)
content = resp.json()
@aet
aet / gist:995476964b3a59883ebe
Created July 7, 2015 19:47
mDNSResponder workaround
Annoyed by mDNSResponder flood like this after OS X Yosemite 10.10.4 upgrade?
Jul 7 12:44:11 aet.local mDNSResponder[92] <Error>: Unknown DNS packet type 636F from 10.1.0.78 :63062 to 224.0.0.251 :5353 length 24 on 0000000000000004 (ignored)
Jul 7 12:44:12 aet.local mDNSResponder[92] <Error>: Unknown DNS packet type 636F from 10.1.1.122 :50585 to 224.0.0.251 :5353 length 24 on 0000000000000004 (ignored)
Add the following lines at the beginning of /etc/asl.conf
? [= Sender mDNSResponder] file mDNSResponder.log file_max=128k all_max=128k
? [= Sender mDNSResponder] ignore
@farmisen
farmisen / main.rb
Created July 8, 2012 03:50
pvr.ccz sprite sheet extractor
require 'rubygems'
require 'json'
require 'chunky_png'
PLUTIL = '/usr/bin/plutil'
TEXTUREPACKER = '/usr/local/bin/TexturePacker'
dir = File.join(ARGV[0], '*plist')
out_dir = File.join(Dir.pwd , ARGV[1])
tmp_dir = "/tmp"
@efeminella
efeminella / backbone-persistable-collection.js
Created April 9, 2012 21:10
A Persistable Backbone Collection Implementation
/*!
* Copyright (c) 2012 Eric Feminella, http://code.ericfeminella.com/license/LICENSE.txt
*/
( function( _, Backbone )
{
// convenience reference to the Backbone.Collection constructor
var _initialize = Backbone.Collection.prototype.initialize;
/*
* The Backbone.PersistableCollection provides a simply abstraction which
@darktable
darktable / MiniJSON.cs
Created November 30, 2011 23:08
Unity3D: MiniJSON Decodes and encodes simple JSON strings. Not intended for use with massive JSON strings, probably < 32k preferred. Handy for parsing JSON from inside Unity3d.
/*
* Copyright (c) 2013 Calvin Rien
*
* Based on the JSON parser by Patrick van Bergen
* http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html
*
* Simplified it so that it doesn't throw exceptions
* and can be used in Unity iPhone with maximum code stripping.
*
* Permission is hereby granted, free of charge, to any person obtaining
@0xc010d
0xc010d / ReCodeSign
Created November 14, 2011 22:38
Codesign an iOS app, with a different distribution certificate and mobileprovisioning file.
- Copy the delivered ipa into a directory to work in.
- export PlistBuddy="/usr/libexec/PlistBuddy" to get the PlistBuddy tool to your shell. If it is not added, all references to PlistBuddy
will need to be written as the full path.
- Take the delivered App.ipa and unzip it using the unzip command. This should produce a Payload directory containing the app and its
resources.
- Enter the command "codesign -d --entitlements :enterprise.plist Payload/PathToApp.app/" This pulls the entitlements out of the app, and
prints them to a plist, without a leading "blob" of data. Pay particular attention to the colon before the enterprise.plist file name.