Skip to content

Instantly share code, notes, and snippets.

View DataGreed's full-sized avatar
👾
practicing magic

Alexey Strelkov DataGreed

👾
practicing magic
View GitHub Profile
@DataGreed
DataGreed / RendererExtensions.cs
Created January 17, 2019 21:46
An extension class for Unity Renderer that checks if it's seen from a specified camera
using UnityEngine;
public static class RendererExtensions
{
/// <summary>
/// Checks if the object is visible from a certain camera
/// </summary>
/// <returns><c>true</c>, if visible, <c>false</c> otherwise.</returns>
/// <param name="renderer">Object Renderer</param>
/// <param name="camera">Camera</param>
@DataGreed
DataGreed / GameController.cs
Last active January 15, 2019 02:38
Unity Singleton implementation for GameController, based on Flappy Bird Tutorial.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GameController : MonoBehaviour
{
public static GameController instance;
// Singleton Initialization
void Awake()
#!/bin/env sh
lines=$(tput lines)
cols=$(tput cols)
awkscript='
{
letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()"
lines=$1
@DataGreed
DataGreed / decrypt_message.js
Created June 23, 2017 23:56
PubNub blocks message decrypting (very ugly but works)
export default (request) => {
console.log('--------------------------------------------START')
////////////////////////////////
// ---------- external modules
// sha256
function SHA256(s){
var chrsz = 8;
class MulticastDelegate:
def __init__(self):
self.delegates = []
def add(self, delegate):
self.delegates.append(delegate)
def sub(self, delegate):
self.delegates.remove(delegate)