This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This work is free. You can redistribute it and/or modify it under the | |
* terms of the Do What The Fuck You Want To Public License, Version 2, | |
* as published by Sam Hocevar. See the COPYING file for more details. | |
*/ | |
/* | |
* Easing Functions - inspired from http://gizma.com/easing/ | |
* only considering the t value for the range [0, 1] => [0, 1] | |
*/ | |
EasingFunctions = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Warning! Read and use at your own risk! | |
* | |
* This tiny proxy script is completely transparent and it passes | |
* all requests and headers without any checking of any kind. | |
* The same happens with JSON data. They are simply forwarded. | |
* | |
* This is just an easy and convenient solution for the AJAX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://frarees.github.io/default-gist-license | |
using System; | |
using UnityEngine; | |
[AttributeUsage(AttributeTargets.Field, Inherited = true, AllowMultiple = false)] | |
public class MinMaxSliderAttribute : PropertyAttribute | |
{ | |
public float Min { get; set; } | |
public float Max { get; set; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Author: Mathias Bak Bertelsen | |
* Email: bufas@cs.au.dk | |
* Date: 03-08-2014 | |
* | |
* A very simple implementation of a generic FIFO queue. | |
*/ | |
public class Queue<T> { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void drawString(string text, Vector3 worldPos, Color? colour = null) { | |
UnityEditor.Handles.BeginGUI(); | |
if (colour.HasValue) GUI.color = colour.Value; | |
var view = UnityEditor.SceneView.currentDrawingSceneView; | |
Vector3 screenPos = view.camera.WorldToScreenPoint(worldPos); | |
Vector2 size = GUI.skin.label.CalcSize(new GUIContent(text)); | |
GUI.Label(new Rect(screenPos.x - (size.x / 2), -screenPos.y + view.position.height + 4, size.x, size.y), text); | |
UnityEditor.Handles.EndGUI(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int redPin = 6; | |
int greenPin = 5; | |
int bluePin = 9; | |
float col[3]; | |
float hue = 0.0; | |
void setup() { | |
pinMode(redPin, OUTPUT); | |
pinMode(greenPin, OUTPUT); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef NOISE_SIMPLEX_FUNC | |
#define NOISE_SIMPLEX_FUNC | |
/* | |
Description: | |
Array- and textureless CgFx/HLSL 2D, 3D and 4D simplex noise functions. | |
a.k.a. simplified and optimized Perlin noise. | |
The functions have very good performance | |
and no dependencies on external data. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import math | |
import numpy as np | |
import sys | |
def apply_mask(matrix, mask, fill_value): | |
masked = np.ma.array(matrix, mask=mask, fill_value=fill_value) | |
return masked.filled() | |
def apply_threshold(matrix, low_value, high_value): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.2) | |
project(YourProject) | |
add_subdirectory(src) | |
add_subdirectory(lib) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Here's a look at how I created a quick music player for use with GBDK. | |
It basically defines how to play a note, and then stores an array of notes | |
to be played as a timer interates through the beats */ | |
//Define note names | |
typedef enum { | |
C3, Cd3, D3, Dd3, E3, F3, Fd3, G3, Gd3, A3, Ad3, B3, | |
C4, Cd4, D4, Dd4, E4, F4, Fd4, G4, Gd4, A4, Ad4, B4, | |
C5, Cd5, D5, Dd5, E5, F5, Fd5, G5, Gd5, A5, Ad5, B5, | |
C6, Cd6, D6, Dd6, E6, F6, Fd6, G6, Gd6, A6, Ad6, B6, |
OlderNewer