Skip to content

Instantly share code, notes, and snippets.

View sergebat's full-sized avatar

Sergey Batishchev sergebat

  • Vancouver, BC, Canada
View GitHub Profile
@coastwise
coastwise / VertMinusCameraFOV.cs
Created July 8, 2013 20:16
VERT- Field of view scaling for Unity3D cameras.
using UnityEngine;
using System.Collections;
/**
* This class attempts to force VERT- Field of view scaling.
* By default, Unity uses the HOR+ technique.
*
* http://en.wikipedia.org/wiki/Field_of_view_in_video_games#Scaling_methods
*/
@cosmicmonster
cosmicmonster / ShuffleArray.cs
Last active June 25, 2024 09:16
Unity / C# code to shuffle an array using the Fisher-Yates Shuffle.
using UnityEngine;
using System.Collections;
public class ShuffleArray : MonoBehaviour {
// Public so you can fill the array in the inspector
public int[] scenarios;
void Start ()
@ampedandwired
ampedandwired / README.md
Last active October 6, 2022 06:40
webpack-dev-server with html-webpack-plugin
$ npm install
$ ./node_modules/.bin/webpack-dev-server
$ open http://localhost:8080/webpack-dev-server/

Notes:

  • Note the trailing slash on the URL is significant. Without it webpack-dev-server shows a file listing page.
  • You need 1.0.11 or later of webpack-dev-middleware for this URL to work. With earlier versions you need to specify the full URL like this: http://localhost:8080/webpack-dev-server/index.html.
  • To get a non-autoreloading version of the page use http://localhost:8080/index.html.
@alister
alister / DockerRedis_ExportImport_Dump.sh
Created January 27, 2015 21:46
Example of creating a Docker data volume, exporting it, and re-importing it to a completely fresh container
# Create the container - we run 'echo' in the container, and reuse the same as we will be running later
docker run -d -v /data --name redis.data dockerfile/redis echo Data-only container for Redis
# the data container doesn't show up - nothing is running
docker ps
# will show 'redis.data', but as stopped
docker ps -a
# start redis, attach to 'redis.data'
docker run -d -p 6379:6379 --volumes-from redis.data --name ca.redis.1 dockerfile/redis
@nevernormal1
nevernormal1 / .block
Last active April 17, 2024 07:19
SVG Jigsaw Puzzle Generator
license: MIT
@Guendeli
Guendeli / ToastMessage.cs
Created September 28, 2016 10:08
a script to show Toast Messages on Android Unity3D Apps
using UnityEngine;
public class ToastMessage : MonoBehaviour
{
string toastString;
string input;
AndroidJavaObject currentActivity;
AndroidJavaClass UnityPlayer;
AndroidJavaObject context;
@lehuutien1996
lehuutien1996 / install-docker.sh
Last active February 13, 2018 18:19
Installing Docker bash shell script on Ubuntu
#!/bin/bash
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
@YuriyGuts
YuriyGuts / chocolatey-install-apps.cmd
Last active September 27, 2023 21:22
A script to install all necessary software on a fresh Windows installation using Chocolatey
@echo off
rem ===== Run this first: =====
rem @powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
rem choco feature enable -n=allowGlobalConfirmation
rem mkdir C:\Tools
rem choco install -y toolsroot
rem ===========================
rem ----- Essentials -----
@nagedev
nagedev / SingletonScriptable.cs
Last active October 23, 2018 12:06
SingletonScriptable
using System.Linq;
using UnityEditor;
using UnityEngine;
public abstract class SingletonScriptable<T> : ScriptableObject where T : ScriptableObject
{
static T _instance = null;
public static T instance
{
get
Shader "Custom/ACNH_SewingCloth"
{
Properties
{
[NoScaleOffset] _MainTex ("Albedo (RGB)", 2D) = "white" {}
[NoScaleOffset] _BumpMap ("Normal Map", 2D) = "bump" {}
[NoScaleOffset] _EdgeAlpha ("Alpha", 2D) = "white" {}
_Cutoff ("Alpha Test Cutoff", Range(0,1)) = 0.5
_Offset ("Offset (XY)", Vector) = (0,0,0,0)