Skip to content

Instantly share code, notes, and snippets.

View gonchar's full-sized avatar

Sergey Gonchar gonchar

View GitHub Profile
@gonchar
gonchar / a_visionOS_Xcode_snippets
Last active May 8, 2024 13:12
visionOS Xcode snippets
// hello
https://www.platformer.news/
https://snacks.robinhood.com/
https://future.a16z.com/
https://app.mailbrew.com/unreadit/tech-Rrjzlxqyv6Q1
https://www.deararchitects.xyz/
Shader "Unlit/BlendTextures"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_MainTex2 ("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "Queue"="Transparent" "RenderType"="Transparent" "IgnoreProjector"="True" }
import MaxPlus
import os
import os.path
import pymxs
rt = pymxs.runtime
def convertAllToMeshes(n, indent=''):
objName = n.GetActualINode().Name
if "Line" in objName:
ClassID 100000 (int) conflicts with that of another class (int). Please resolve the conflict.
(Filename: Line: 263)
ClassID 100001 (bool) conflicts with that of another class (bool). Please resolve the conflict.
(Filename: Line: 263)
ClassID 100002 (float) conflicts with that of another class (float). Please resolve the conflict.
@gonchar
gonchar / assetwriter.swift
Created December 10, 2015 09:43
assetwriter in swift
// var videoWriter: AVAssetWriter = try! AVAssetWriter(URL: self.movieUrl, fileType: AVFileTypeQuickTimeMovie)
//
// var avAsset: AVAsset = AVURLAsset(URL: self.tempMovieURL!, options: nil)
//
// let compressionSettings = [
// //AVVideoMaxKeyFrameIntervalKey: 1,
// AVVideoAverageBitRateKey: 10 * 1000000
// ]
//
@gonchar
gonchar / generator.d.ts
Created November 11, 2015 19:45
Photoshop Generator typescript
declare module "generator" {
export interface Plugin {
metadata:JSON;
plugin:Object;
config:Object;
}
export interface MenuState {
enabled:Boolean;
checked:Boolean;
@gonchar
gonchar / .gitconfig
Created November 5, 2015 12:34
git aliases
[alias]
# full status
rstatus = !sh -c 'git status -sb --ignore-submodules=dirty && git submodule foreach --recursive git status -sb --ignore-submodules=dirty' -
rstatus-no-subs = !sh -c 'git status -sb --ignore-submodules=all && git submodule foreach --recursive git status -sb --ignore-submodules=all' -
s = !sh -c 'git rstatus-no-subs' -
# fetches all modules
rfetch = !sh -c 'git fetch && git submodule foreach --recursive git fetch' -
# updates project and all submodules
r-fetch-pull-merge = !sh -c 'git rfetch && git submodule foreach --recursive git merge && git merge && git s' -
r-fetch-pull-rebase = !sh -c 'git rfetch && git submodule foreach --recursive git rebase && git rebase && git s' -
@gonchar
gonchar / singleton.cs
Created September 30, 2015 16:27
unity3d singleton
using UnityEngine;
/// <summary>
/// Be aware this will not prevent a non singleton constructor
/// such as `T myT = new T();`
/// To prevent that, add `protected T () {}` to your singleton class.
///
/// As a note, this is made as MonoBehaviour because we need Coroutines.
/// </summary>
public class Singleton<T> : MonoBehaviour where T : MonoBehaviour
@gonchar
gonchar / gist:492cdb3bd0b574c0c84d
Created June 15, 2015 18:31
true localToLocal for Starling
private static var transform:Matrix = new Matrix();
private static var transformInverse:Matrix = new Matrix();
private static var path:Vector.<DisplayObject> = new Vector.<DisplayObject>();
public static function localToLocal(source:DisplayObject, target:DisplayObjectContainer = null, objChildOfTarget:Boolean = true):void
{
if (target == null || source == null) return;
transform.identity();
transform.copyFrom(source.transformationMatrix);
var parent:DisplayObject = source as DisplayObject;