Skip to content

Instantly share code, notes, and snippets.

View yoshikischmitz's full-sized avatar
🐳
Focusing

Yoshiki Schmitz yoshikischmitz

🐳
Focusing
View GitHub Profile
@JakubNei
JakubNei / DeferredSynchronizeInvoke.cs
Last active December 29, 2024 10:46
Implementation of ISynchronizeInvoke for Unity3D game engine. Can be used to invoke anything on main Unity thread. ISynchronizeInvoke is used extensively in .NET forms, it's is elegant and quite useful in Unity as well. I implemented it so i can use it with System.IO.FileSystemWatcher.SynchronizingObject.
/*
Implementation of ISynchronizeInvoke for Unity3D game engine.
Can be used to invoke anything on main Unity thread.
ISynchronizeInvoke is used extensively in .NET forms, it's is elegant and quite useful in Unity as well.
I implemented it so i can use it with System.IO.FileSystemWatcher.SynchronizingObject.
help from: http://www.codeproject.com/Articles/12082/A-DelegateQueue-Class
example usage: https://gist.github.com/aeroson/90bf21be3fdc4829e631
version: aeroson 2017-07-13 (author yyyy-MM-dd)
@fxg42
fxg42 / optional.ex
Last active August 29, 2015 14:14
Maybe monad with Elixir
defmodule Optional do
def unit(nil), do: {:err, nil}
def unit(value), do: {:ok, value}
def lift(func) do
fn input -> unit(func.(input)) end
end
def bind({:ok, optional}, functor), do: functor.(optional)
def bind(err, _), do: err
@staltz
staltz / introrx.md
Last active May 15, 2025 10:37
The introduction to Reactive Programming you've been missing
@smd686s
smd686s / Gemfile
Last active October 27, 2016 02:16
Use Strong Parameters in a Grape API without Rails
gem "actionpack", "~> 4.0.0"
@Kerrick
Kerrick / fizzbuzz.rb
Created April 24, 2012 20:36
Different solutions for Fizz Buzz in Ruby
def fizz_buzz_1(max)
arr = []
(1..max).each do |n|
if ((n % 3 == 0) && (n % 5 == 0))
arr << "FizzBuzz"
elsif (n % 3 == 0)
arr << "Fizz"
elsif (n % 5 == 0)
arr << "Buzz"
else