Skip to content

Instantly share code, notes, and snippets.

View asfdfdfd's full-sized avatar

Andrey Panchenko asfdfdfd

View GitHub Profile
@ignacio
ignacio / await.lua
Created April 2, 2013 13:54
await wrapper using coroutines (related to this gist: https://gist.github.com/creationix/5291866)
function await(continuation)
local coro = coroutine.running()
local result
local async
continuation(function(err, value)
if async == nil then
async = false
result = value
if err then error(err) end
return
@bzerangue
bzerangue / _verify-repair-permissions-disk.md
Last active July 25, 2024 18:52
Mac OS X Utilities via Terminal: (Verify and Repair: Disk Permissions AND Disk / Software Update / TimeMachine)

Verify and Repair Disk Permissions via Terminal (Mac OS X)

Verify Permissions

diskutil verifyPermissions /

Repair Permissions

diskutil repairPermissions /

@elringus
elringus / BlendModes.c
Last active March 11, 2024 11:32
Popular blend mode algorithms implemented in Nvidia's Cg. https://elringus.me/blend-modes-in-unity/
fixed3 Darken (fixed3 a, fixed3 b)
{
return min(a, b);
}
fixed3 Multiply (fixed3 a, fixed3 b)
{
return a * b;
}
private void takePicture() {
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
if (takePictureIntent.resolveActivity(getPackageManager()) != null) {
Uri photoURI = null;
try {
File photoFile = createImageFileWith();
path = photoFile.getAbsolutePath();
photoURI = FileProvider.getUriForFile(MainActivity.this,
getString(R.string.file_provider_authority),
photoFile);
@y2k
y2k / lite-moxy.kt
Created February 15, 2019 13:13
lite moxy
interface LitePresenter<T : Any> {
fun attachView(view: LiteView<T>)
fun detachView()
}
open class BaseLitePresenter<T : Any> : LitePresenter<T> {
private val buffer = ArrayList<T>()
private var view: LiteView<T>? = null
private var firstAttached = false
@Nrjwolf
Nrjwolf / HomingMissile.cs
Last active July 1, 2020 08:32
Homing Missile. The algorithm is taken from http://www.freeactionscript.com/tag/game-examples/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class HomingMissile : MonoBehaviour
{
[GetComponent] [SerializeField] private Rigidbody2D m_Rigidbody2D;
public Rigidbody2D Rigidbody2D { get => m_Rigidbody2D; }
public Transform Target;
using System.Collections;
using System.Collections.Generic;
using Nrjwolf.Tools.AttachAttributes; // https://github.com/Nrjwolf/unity-auto-attach-component-attributes
using TMPro;
using UnityEngine;
[RequireComponent(typeof(TextMeshProUGUI))]
public class TextMeshProTeletypeEffect : MonoBehaviour
{
[GetComponent] [SerializeField] private TextMeshProUGUI m_TextMeshProUGUI;