This file contains hidden or 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
<?php | |
// Required if you are putting in a namespace: | |
// namespace app\helpers; | |
// use InvalidArgumentException; | |
/** | |
* Packs / Unpacks a integer ID into a pseudo faux UUID's ( 8-8-12 ) with signature to verify origins. | |
* Not secure, but provides an abstraction layer to hide the true nature of your database. | |
* |
This file contains hidden or 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 Level : Singleton<Level> | |
{ | |
public void DoStuff(); | |
} | |
void OtherAccess() { | |
Level.instance.DoStuff(); | |
} |
This file contains hidden or 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
// Author: Lachee | |
// License: Public Domain - Do what you want with it | |
// Note: Script to convert line endings in unity so you dont get those annoying warnings. | |
// Simply put this script in a folder called Editor, then go Tools -> EOL Conversion -> Windows/Unix | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Text.RegularExpressions; | |
using UnityEngine; | |
using UnityEditor; |
This file contains hidden or 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
// Starts a restream at 480p | |
async Task RestreamLowQuality(string channelName) { | |
var availableStreams = await Sniffer.GetStreamsAsync(channelName); // Fetch all the available streams | |
var stream = availableStreams.Where(s => s.QualityNo == 480).FirstOrDefault(); // Get just the 480, otherwise the best we can. | |
return BeginRestream(stream.Url); // Pass it to FFMPEG to restream it | |
} | |
// Starts FFMPEG to restream the url. This avoids SSL issues with OpenCV | |
private Process BeginRestream(string url, bool sync = false, bool verbose = false) | |
{ |
This file contains hidden or 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.IO; | |
#if UNITY_5_3_OR_NEWER | |
using UnityEngine; | |
#else | |
using System.Numerics; | |
#endif | |
namespace Lachee.Dynamic |
This file contains hidden or 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 UnityEngine; | |
public class LevelManager : Singleton<LevelManager> { | |
private void Start() { | |
Debug.Log("This is a singleton!", LeveLManager.instance); | |
} | |
public IEnumerator SoftWaitExample() { | |
yield return LevelManager.wait; |
This file contains hidden or 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 Why : Span<U>, IDisposable where U : struct | |
{ | |
const sbyte BECAUSE_YES = 2; | |
public object Contents { get => (string)this; set { _ = value; } }; | |
public void Dispose() { throw new NotImplementedException(); } | |
public static explicit operator string(Why y) { return "cause fuck you"; } | |
} | |
public async IAsyncEnumerable<T> OhGod<T>(T t) where T : Why | |
{ |
This file contains hidden or 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
/** | |
Generate a grid of all permutations of a binary (black and white) NxN pixel image (where n is between 2 and 5). | |
Then filter it so it removes: | |
all rotationally symmetric patterns ( rotating it 90 is considered the same patterns ) | |
all non-contiguous patterns ( all the white islands must be connected ) | |
all translationally the same patterns (dont know the term) ( if you move it some distance to the left, its considered the same pattern ) ( i solved this by cropping the image to best fit and then scaling back up ) | |
The result hopefully should be unique tetris pieces | |
*/ | |
const canvas = document.querySelector('canvas#shapes'); |
This file contains hidden or 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
--- | |
--- | |
@import "{{ site.theme }}"; | |
/** | |
Custom dark theme for Github Pages, by Lachee. | |
Put this exactly /assets/css/style.scss in your GitHub Pages root. | |
*/ |
This file contains hidden or 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
class Config | |
{ | |
public string Project { get; set; } = "AProject"; | |
public string Repository { get; set; } = "ARepo"; | |
public string Organization { get; set; } = "https://dev.azure.com/org"; | |
public LazyKey Credentials { get; set; } = "devops.key"; | |
} |