Skip to content

Instantly share code, notes, and snippets.

View wowbroforce's full-sized avatar

Prokhor Kharchenko wowbroforce

View GitHub Profile
//
// AVMediaCharacteristic+Extensions.swift
//
// Created by Prokhor Kharchenko.
//
import AVFoundation
import MediaPlayer
extension AVMediaSelectionOption {
; Hold 'Shift' to start the script, hold 'Control' to stop.
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
delay := 666
isDisabled := true
Loop {
Sleep delay
if (GetKeyState("Control")) {
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[System.AttributeUsage(System.AttributeTargets.Field)]
public class StringToEnumAttribute : PropertyAttribute
{
public string[] values;
public StringToEnumAttribute(params string[] values)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
public class GameEventListener : MonoBehaviour
{
public GameEvent @event;
public UnityEvent response;
using UnityEngine;
using System.Collections.Generic;
[CreateAssetMenu(fileName = "GameEvent", menuName = "~/Assets/Scripts/GameEvent", order = 0)]
public class GameEvent : ScriptableObject
{
private List<GameEventListener> listeners = new List<GameEventListener>();
public void Raise()
{
for (var i = listeners.Count - 1; i >= 0; i--)
using UnityEngine;
[CreateAssetMenu(fileName = "FloatVariable", menuName = "~/Assets/Scripts/FloatVariable")]
public class FloatVariable : Variable<float> { }
@wowbroforce
wowbroforce / GLSL-Noise.md
Created February 14, 2018 08:28 — forked from patriciogonzalezvivo/GLSL-Noise.md
GLSL Noise Algorithms

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
	return mix(rand(fl), rand(fl + 1.0), fc);
}
@wowbroforce
wowbroforce / insert_build_phases.rb
Created January 7, 2017 21:19
Example of adding 'Shell Script Build Phase' to Xcode project using Fastlane action and Xcodeptoj tool
module Fastlane
module Actions
module SharedValues
INSERT_BUILD_PHASES_CUSTOM_VALUE = :INSERT_BUILD_PHASES_CUSTOM_VALUE
end
class InsertBuildPhasesAction < Action
def self.run(params)
require 'xcodeproj'
@wowbroforce
wowbroforce / CoroutineExtensions.cs
Last active August 29, 2015 14:22
Simple actions, based on coroutines and callbacks. Delays, loops etc...
using UnityEngine;
using System.Collections;
using System;
public static class CoroutineExtensions {
public static void StartWaitForSeconds(this MonoBehaviour target, float seconds, Action completion) {
target.StartCoroutine (WaitForSeconds (seconds, completion));
}
using UnityEngine;
using System.Collections;
public static class GameObjectExtensions {
public static GameObject Instantiate(this Object prefab) {
return GameObject.Instantiate (prefab) as GameObject;
}
}