Skip to content

Instantly share code, notes, and snippets.

View starikcetin's full-sized avatar

S. Tarık Çetin starikcetin

View GitHub Profile
@luke161
luke161 / AddressablesSceneLoader.cs
Last active March 29, 2024 12:02
Handles loading and unloading of Scenes using Unity's Addressable Assets system. Adds support for using LoadSceneParameters when loading a scene, which is currently missing in the official APIs.
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.AddressableAssets.ResourceLocators;
using UnityEngine.ResourceManagement;
using UnityEngine.ResourceManagement.ResourceLocations;
using UnityEngine.ResourceManagement.ResourceProviders;
using UnityEngine.ResourceManagement.AsyncOperations;
using UnityEngine.SceneManagement;
using System.Collections;
using System.Collections.Generic;
@lxlgarnett
lxlgarnett / take-screenrecord.sh
Created September 7, 2020 12:24
Records screen record of Android device by using adb command.
#!/bin/bash
date_string=`date +%F-%s`
# Creates Screenrecords directory if not exist.
mkdir -p Screenrecords
function finish() {
adb shell pkill -SIGINT screenrecord
adb pull /sdcard/screenrecord_"$date_string".mp4 ./Screenrecords/
adb shell rm /sdcard/screenrecord_"$date_string".mp4
@ppoffice
ppoffice / README.md
Last active April 30, 2024 20:48
Install Visual Studio Code (actually code-server) on Android
  1. Install Termux, an Android terminal emulator that provides a Linux execution environment and various tools.

  2. Update system packages in Termux:

    $ pkg update -y
@bartvanandel
bartvanandel / yarn-sync.js
Last active November 15, 2022 22:41
Sync versions from yarn.lock back into package.json
const fs = require("fs");
/**
* Removes matching outer quotes from a string.
*
* @param {string} text - String to unquote
* @returns {string} - Unquoted string
*/
const unquote = text => /(["'])?(.*)\1/.exec(text)[2];
@liortal53
liortal53 / EmbedPackage.cs
Created October 25, 2019 07:19
Embed package into your Unity project to modify the code more easily :)
using System.IO;
using UnityEditor.PackageManager;
using UnityEngine;
namespace UnityEditor.Extensions
{
#if UNITY_2017_3_OR_NEWER
/// <summary>
/// Editor extension for embedding packages as a local copy in the project.
@FlaShG
FlaShG / GizmosColor.cs
Last active August 19, 2021 18:52
Temprarily set a color to be used for Gizmos and Handles.
using UnityEngine;
using System;
/// <summary>
/// Temporarily set a color to be used for Gizmos.
/// <example>
/// <code>
/// using (new GizmosColor(Color.red))
/// {
@palozano
palozano / rsync_usage.md
Last active June 13, 2023 15:50
Rsync usage

Notes on using rsync

First, install it, using apt, yum, pacman, etc.

Local usage

Imagine we want to back up files from Directory1 to Directory2, and both are on the same hard drive (this would work the same if the directories are on two different drives). There are several different ways to do this, depending on what kind of backups (i.e., options you want to give rsync) you want to configure. The most general, will be this:

$ rsync -av --delete /Directory1/ /Directory2/
@WrathChaos
WrathChaos / git-alias.md
Last active May 13, 2021 15:39
MacOS .zshrc Aliases

Git Aliases

alias status="artii 'Status' | nyan && git status | nyan"
alias add="git add . | artii "Staged" | nyan"
alias glocal="git checkout local | artii 'Local Branch' | nyan"
alias dev="git checkout dev | artii 'Dev Branch' | nyan"
alias master="git checkout master | artii 'Master Branch' | nyan"
alias log="artii 'Logs' | nyan  && git log | nyan"
alias branch="artii 'Branches' | nyan &amp;&amp; git branch | nyan"
@balbuf
balbuf / supports.scss
Created February 6, 2019 19:16
"supports" SASS mixin that provides minimal DRY benefits
@mixin supports($property-dec) {
// find position of colon in property declaration
$colon: str-index($property-dec, ':');
// extract the property
$property: str-slice($property-dec, 1, $colon - 1);
// extract the value
$value: str-slice($property-dec, $colon + 1);
// trim leading spaces
@while (str-slice($value, 1, 1) == ' ') {
$value: str-slice($value, 2);
@JohannesMP
JohannesMP / LICENSE
Last active March 9, 2024 11:26
[Unity3D] A Reliable, user-friendly way to reference SceneAssets by script.
/*******************************************************************************
* Don't Be a Jerk: The Open Source Software License.
* Adapted from: https://github.com/evantahler/Dont-be-a-Jerk
*******************************************************************************
* _I_ am the software author - JohannesMP on Github.
* _You_ are the user of this software. You might be a _we_, and that's OK!
*
* This is free, open source software. I will never charge you to use,
* license, or obtain this software. Doing so would make me a jerk.
*