Skip to content

Instantly share code, notes, and snippets.

View dmitrymatveev's full-sized avatar

Dmitry Matveev dmitrymatveev

  • Auckland, New Zealand
View GitHub Profile
@tygerbytes
tygerbytes / Register-DynamicArgumentCompleters.ps1
Last active June 19, 2021 07:13
Register tab completion for custom commands that change depending on the current directory.
param(
[Parameter(Mandatory=$true)]
[String[]]$commandsToComplete)
<#
.SYNOPSIS
Register tab completion for custom commands that change depending on the current directory.
Source: https://gist.github.com/tygerbytes/833a73fe77f1f426f1f094c6ae7b5b2c
Author: Ty Walls (https://twitter.com/tygertec)
Website: https://www.tygertec.com
@nicoplv
nicoplv / 0-UnityScriptTemplates.info
Last active May 10, 2024 16:41
List of C# Script Templates for Unity 3D
List of C# Script Templates for Unity 3D:
81-C#__Behavior-NewBehaviour.cs.txt
81-C#__BehaviorListed-NewBehaviourListed.cs.txt
81-C#__Class-NewClass.cs.txt
81-C#__Interface-NewInterface.cs.txt
81-C#__ScriptableObject-NewScriptableObject.cs.txt
@Volcanoscar
Volcanoscar / greyscale.frag
Created January 19, 2017 08:28 — forked from wiseoldduck/greyscale.frag
A simple glsl color -> greyscale shader, using luminosity method
// fragment shader
//
// RGBA color to RGBA greyscale
//
// smooth transition based on u_colorFactor: 0.0 = original, 1.0 = greyscale
//
// http://www.johndcook.com/blog/2009/08/24/algorithms-convert-color-grayscale/
// "The luminosity method is a more sophisticated version of the average method.
// It also averages the values, but it forms a weighted average to account for human perception.
// We’re more sensitive to green than other colors, so green is weighted most heavily. The formula
@kouk
kouk / How to add a submodule with shallow checkout and shallow clone
Last active April 17, 2024 20:16
.How to add a submodule with shallow checkout and shallow clone
If you have a huge repository (in size and in history) and want to add a subfolder
to your project as a submodule you can follow this example to save time and space
using git's shallow clone and shallow checkout feature. It is a bit more complicated
in this example because I assume that you want your submodule to track a non-default
branch, called `mybranch`, instead of the `master` branch. Things could probably get
a lot simpler when using the default branch. After following the commands in these
examples you can use `git submodule update` and `git submodule update --remote` as normal.
@gubatron
gubatron / multiple-deploy-keys-multiple-private-repos-github-ssh-config.md
Last active July 10, 2024 03:50
How to configure multiple deploy keys for different private github repositories on the same computer without using ssh-agent

How to configure multiple deploy keys for different private github repositories on the same computer without using ssh-agent

Let's say alice is a github.com user, with 2 or more private repositories repoN. For this example we'll work with just two repositories named repo1 and repo2

https://github.com/alice/repo1

https://github.com/alice/repo2

You need to be to pull from these repositories without entering a passwords probably on a server, or on multiple servers.

@leegrey
leegrey / inherit.js
Last active October 12, 2015 21:47
inherit.js - a minimal prototype inheritance utility
/*
Inherit copyright 2012 by Lee Grey
license: MIT
http://creativecommons.org/licenses/MIT/
http://opensource.org/licenses/mit-license.php
The goal of the Interit class is to allow for a prototype based inheritance that
does not create a deep prototype chain. Inherited fields are known to be slow,
so methods and fields are simply copied onto the prototype of the target,
keeping only a single depth.
@cuppster
cuppster / 1.cs
Created September 3, 2012 18:39
Promises for C# using Generics
/*
modified from original source: https://bitbucket.org/mattkotsenas/c-promises/overview
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Promises
@AngryAnt
AngryAnt / Multiply.cs
Created August 1, 2011 14:58
A simple example of a multiply blend in Unity. http://en.wikipedia.org/wiki/Blend_modes#Multiply
using UnityEngine;
using System.Collections;
public class Multiply : MonoBehaviour
{
public Camera source, destination;
private RenderTexture renderTexture;
@ryanflorence
ryanflorence / static_server.js
Last active July 21, 2024 12:43
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);