Skip to content

Instantly share code, notes, and snippets.

@skistua
skistua / TimeZone.md
Created November 22, 2022 11:21 — forked from sjimenez44/TimeZone.md
Change time zone Docker container

Change TimeZone in Docker containers

With Docker Engine

The timezone of a container can be set using an environment variable in the docker container when it is created. For example:

$ docker run ubuntu:latest date
Sat Feb 27 15:58:32 UTC 2021
$ docker run -e TZ=America/Bogota ubuntu:latest date
Sat Feb 27 15:58:40 Asia 2021
@skistua
skistua / CacheableDownloadHandler.cs
Created February 9, 2022 02:58 — forked from mob-sakai/CacheableDownloadHandler.cs
Etag-cacheable DownloadHandler for Unity.
using UnityEngine.Networking;
using System.IO;
using System.Security.Cryptography;
using System.Text;
using UnityEngine;
using System;
namespace Mobcast.Coffee.AssetSystem
{
@skistua
skistua / SaveRenderTextureToFile.cs
Last active June 15, 2021 11:45 — forked from krzys-h/SaveRenderTextureToFile.cs
[Unity] Save RenderTexture to image file
using System.IO;
using UnityEditor;
using UnityEngine;
public class ScreenShotWindow : EditorWindow
{
private Camera m_Camera;
private string filePath;
private bool m_IsEnableAlpha = false;
private CameraClearFlags m_CameraClearFlags;
@skistua
skistua / .vimrc
Created January 21, 2021 16:26 — forked from jdavid82/.vimrc
vim settings for full stack C# development in Windows 10
"Allow project specific .vimrc execution
set exrc
"no backup files
set nobackup
"only in case you don't want a backup file while editing
set nowritebackup
"no swap files
git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
git config --global http.proxy 'socks5://127.0.0.1:1080'
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FPSCounter : MonoBehaviour{
private int _count = 0;
private int _total = 0;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class Slice : MonoBehaviour {
struct Triangle
{
public Vector3 v1;
public Vector3 v2;
@skistua
skistua / android-adb-pull-apk.md
Created October 26, 2019 15:43 — forked from ctrl-freak/android-adb-pull-apk.md
Retrieve APK from Non-Rooted Android Device through ADB

https://stackoverflow.com/a/18003462/348146

None of these suggestions worked for me, because Android was appending a sequence number to the package name to produce the final APK file name (this may vary with the version of Android OS). The following sequence of commands is what worked for me on a non-rooted device:

  1. Determine the package name of the app, e.g. com.example.someapp. Skip this step if you already know the package name.

    adb shell pm list packages

    Look through the list of package names and try to find a match between the app in question and the package name. This is usually easy, but note that the package name can be completely unrelated to the app name. If you can't recognize the app from the list of package names, try finding the app in Google Play using a browser. The URL for an app in Google Play contains the package name.

@skistua
skistua / cs
Created December 5, 2018 06:46
C# Enum,Int,String的互相转换
Enum为枚举提供基类,其基础类型可以是除 Char 外的任何整型。如果没有显式声明基础类型,则使用Int32。编程语言通常提供语法来声明由一组已命名的常数和它们的值组成的枚举。
注意:枚举类型的基类型是除 Char 外的任何整型,所以枚举类型的值是整型值。
Enum 提供一些实用的静态方法:
(1)比较枚举类的实例的方法
(2)将实例的值转换为其字符串表示形式的方法
@skistua
skistua / sublime-project
Created November 30, 2018 05:51
SublimeTextUnityProjectTemplate
{
"folders":
[
{
"path": "./Assets",
"file_exclude_patterns":["*.meta","*.csproj","*.booproj",".unityproj","*.prefab"]
}
],
"solution_file":"XXX.sln"
}