Skip to content

Instantly share code, notes, and snippets.

View TermiT's full-sized avatar

Gennadii Potapov TermiT

View GitHub Profile
@desplesda
desplesda / CaptureEditorScreenshots.cs
Created January 29, 2020 01:31
Methods for capturing screenshots of the game view and the inspector in Unity (2018.3+)
// Drop these methods into a class in a folder named 'Editor'
[MenuItem("X/Capture Game &1")]
static void CaptureGameScreenshot()
{
EditorApplication.delayCall += () =>
{
var sceneName = UnityEngine.SceneManagement.SceneManager.GetActiveScene().name;
@dpid
dpid / how-to-notarize-unity-for-macos.md
Last active December 6, 2023 20:42
How to notarize a Unity build for MacOs 10.15 Catalina

How to notarize a Unity build for macOs 10.15 Catalina

As of January 2020, all apps running on macOs 10.15 Catalina are required to be notarized. For Unity games distributed outside the Mac App Store, such as with Steam, the notarization process is done post build using a series of Xcode command line tools.

Prerequisites

  • a Mac that is compatible with macOs 10.15 Catalina :
    • MacBook (2015 or newer)
    • MacBook Air (2012 or newer)
  • MacBook Pro (2012 or newer)
@DaveWoodCom
DaveWoodCom / fixXcode6OnElCapitan.sh
Last active September 8, 2023 21:02
Script to fix Xcode 6.x so that it will run on El Capitan
#!/bin/bash
## Copyright (C) 2015 Cerebral Gardens http://www.cerebralgardens.com/
##
## Permission is hereby granted, free of charge, to any person obtaining a copy of this
## software and associated documentation files (the "Software"), to deal in the Software
## without restriction, including without limitation the rights to use, copy, modify,
## merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
## permit persons to whom the Software is furnished to do so, subject to the following
## conditions:
@tjetzinger
tjetzinger / gist:4059880
Created November 12, 2012 15:08 — forked from debrouwere/gist:809993
Nested resources in django-tastypie
from sandbox import models
from tastypie import fields
from apibase.resources import CamayakModelResource
from django.conf.urls.defaults import url
class ModelResource(CamayakModelResource):
def override_urls(self):
urls = []
for name, field in self.fields.items():
@DAddYE
DAddYE / hack.sh
Created March 19, 2012 11:31
OSX For Hackers
#!/bin/sh
##
# This is a script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# Run in interactive mode with:
# $ sh -c "$(curl -sL https://raw.github.com/gist/2108403/hack.sh)"
#
# or run it without prompt questions:
@pec1985
pec1985 / TableViewIndex.js
Last active September 25, 2015 11:08
Get the right column of letters on a table view
/* Ever wondered how to get the nice column of letters in the right side
* of the table view?
*
* Here is an example:
* 1. We take a list of names from a json file
* 2. We need to sort them by either first name or last name
* 3. We need to create a row header once in a while, when the first letter changes
* 4. We need to create a table index
*
*/
@CJReed
CJReed / datetime_properties_in_titanium
Created April 9, 2011 10:23
Storing date/time properties in Titanium Mobile
// CJ_Reed, 9th Apr 2011
// ---------------------
// Storing date/time properties in Titanium Mobile
// (Rather than convert to text and back)
// create array and insert date/time value
var rightNowArray = [];
var rightNow = new Date();
rightNowArray.push({time:rightNow});
@pec1985
pec1985 / slide-to-unlock.js
Created March 23, 2011 22:35
Titanium Mobile code for slider control functionality
// Titanium Mobile code for slider control functionality
//----------------------------------------
// @CJ_Reed 23rd Dec 2010
var sliderView = Titanium.UI.createView({top:100,height:50,left: 40,width:240,backgroundColor:'#000'});
var sliderButton = Titanium.UI.createView({width:96,borderRadius:5,backgroundColor:'#bbb',height:sliderView.height,left:sliderView.left,top:sliderView.top});
Titanium.UI.currentWindow.add(sliderView);
Titanium.UI.currentWindow.add(sliderButton);
function unlock (){
@pec1985
pec1985 / mySuperCoolRow.js
Created March 23, 2011 22:33
Center the title of a row with the Super Cool Row function
// Created by @pecdev with the help of @pec1985
// Follow either on Twitter
//
// Center the title of a row with the Super Cool Row function
var tableData = [];
function mySuperCoolRow(e){
var row = Ti.UI.createTableViewRow({backgroundColor:e.bgColor,height:e.height});
var label = Ti.UI.createLabel({text:e.title,width:'auto',height:50,font:{fontSize:20,fontWeight:'bold'}});
@pec1985
pec1985 / PlayingWithDates.js
Created March 18, 2011 22:40
date in UTC and Current
function utcDate(e){
var day = e.getUTCDate();
var month = e.getUTCMonth()+1;
var year = e.getUTCFullYear();
var hour = e.getUTCHours();
var minutes = e.getUTCMinutes();
var seconds = e.getUTCSeconds();
if(month<10){month = '0'+month;}
if(day<10){day = '0'+day;}
if(hour<10){hour = '0'+hour;}