View EventManager.cs
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
using System; | |
using System.Collections.Generic; | |
using System.Runtime.InteropServices; | |
using UnityEngine; | |
public class EventManager : MonoBehaviour | |
{ | |
private Dictionary<string, Action<EventParam>> eventDictionary; | |
View gist:7672b55cb7dade725bc404a915635528
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
[ | |
{ | |
"code": "TR", | |
"icaoCode": "TUR", | |
"name": "Turkish Republic", | |
"phoneCode": "90", | |
"schengen": false | |
}, | |
{ | |
"code": "CP", |
View Dragger.cs
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
using System; | |
using DG.Tweening; | |
using UnityEngine; | |
using UnityEngine.Events; | |
using UnityEngine.EventSystems; | |
public class Dragger : MonoBehaviour, IDragHandler | |
{ | |
public GameObject target; | |
public bool dragable = true; |
View human.cr
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
def human_time(time) | |
time = time.gsub("T", " ") | |
time = Time.parse(time, "%F %T", Time::Kind::Utc) | |
now = Time.utc_now | |
diff = (now - time) | |
if diff < 5.minutes | |
"just now" | |
elsif diff < 1.hour |
View util.cr
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
def to_param(title) | |
original = ["ş","Ş","ı","I","İ","ğ","Ğ","ü","Ü","ö","Ö","Ç","ç","(",")","/",":",","] | |
replacements = ["s","s","i","i","i","g","g","u","u","o","o","c","c","","","-","-",""] | |
new_text = title.downcase.tr(original.join, replacements.join) | |
new_text = new_text.downcase.gsub(/[^a-zA-Z0-9]+/, "-").gsub(/-{2,}/, "-") | |
if new_text[new_text.size - 1].to_s == "-" | |
new_text = new_text.chomp("-") | |
end |