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
Base = {} | |
function Base:new() | |
local obj = {foo = 'asdf'} | |
return setmetatable(obj, { __index = self }) | |
end | |
function Base:run() | |
print(self.foo) | |
end |
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
public class Ref<T> where T: struct | |
{ | |
T _value; | |
public Ref(T value) | |
{ | |
_value = value; | |
} | |
public T 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
using System.Collections.Generic; | |
using System.IO; | |
using UnityEngine; | |
using UnityEditor.SceneManagement; | |
using UnityEditor; | |
using System.Collections; | |
using System.Linq; | |
public class MultiSceneSetup : ScriptableObject | |
{ |
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
unmapAll | |
let scrollstep = 75 | |
let barposition = "bottom" | |
let mapleader = "," | |
set typelinkhints | |
set numerichints |
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
" Normal way of declaring variable arguments with default values: | |
function! ExampleFunc1(fix1, fix2, ...) | |
let var1 = a:0 > 0 ? a:1 : 'defaultVal1' | |
let var2 = a:0 > 1 ? a:2 : 5 | |
echo a:fix1 .','. a:fix2 .','. var1 .','. var2 | |
endfunction | |
" Alternative approach using a command: |
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
let s:startedScrolling = 0 | |
function! g:TriggerCompletion() | |
if pumvisible() | |
call s:OnStartScrolling() | |
return "\<C-n>" | |
endif | |
return "" | |
endfunction |
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
public class AsyncTaskProcessor : ITickable | |
{ | |
public event Action LoadStarted = delegate {}; | |
public event Action LoadComplete = delegate {}; | |
// New workers to prevent a process from being popped before completion | |
List<WorkerData> _newWorkers = new List<WorkerData>(); | |
// We use a stack here because otherwise sub process of current workers would never execute | |
// causing a state of limbo. |
NewerOlder