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
// License Public Domain - miyu on Github | |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Reflection; | |
using System.Runtime.CompilerServices; | |
namespace Dargon.Commons.Collections { | |
public struct EnumeratorToEnumerableAdapter<TItem, TEnumerator> : IEnumerable<TItem> where TEnumerator : struct, IEnumerator<TItem> { |
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
<!DOCTYPE> | |
<!-- | |
Public Domain from https://github.com/miyu | |
The output looks something like https://imgur.com/a/dGaHxaK (randomized images) | |
--> | |
<html> | |
<head> | |
<style> | |
html { | |
padding:0; |
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
Run the first script in console at a page like https://west.paxsite.com/en-us/schedule.html | |
Then run the second script a split second later (the first script makes asynchronous calls that are pretty fast). | |
You might need to update the API key in 'https://api-melupufoagt.stackpathdns.com/api/schedules?key=6f51c8aa-c4cd-4391-900c-ed9e1b1e6ad8&id='+eventId | |
Simply visit a page like https://west.paxsite.com/content/sitebuilder/rna/pax/west/en-us/schedule/panel-information.html?gtID=746173&panel-name=PAX-Arena-Preshow view the API request in chrome inspector, and reuse that key. | |
The second script dumps a table to the bottom of the document, which you can copy-paste into gdocs (click and drag from the start of the first table to the end of the document, copy, paste to gdocs) | |
If something breaks or you improve this and want to update the document at https://docs.google.com/document/d/1QLp2hcfH_Si8-01bkFifMU-3lYEF2FrOOWj3L0nPkB4/edit# | |
Contact me! https://www.reddit.com/user/itzwarty https://twitter.com/ItzWarty War |
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
Dargon_Luna_Demos_DiffuseShader___FragmentInput Dargon_Luna_Demos_DiffuseShader___Vert(inout Dargon_Luna_Demos_DiffuseShader self, Dargon_Luna_Demos_DiffuseShader___VertexInput i) { | |
Dargon_Luna_Demos_DiffuseShader___FragmentInput o = {}; | |
o.position = Dargon_Luna_Lang_Shader___ObjectToClipPosition(self, i.vertex); | |
o.normalWorld = Dargon_Luna_Lang_Shader___ObjectToWorldNormal(self, i.normal); | |
o.color = i.color; | |
Dargon_Luna_Lang_float4 dummy = {}; | |
return o; | |
} | |
Dargon_Luna_Lang_float4 Dargon_Luna_Lang_Shader___ObjectToClipPosition(inout Dargon_Luna_Lang_Shader self, Dargon_Luna_Lang_float4 v) { |
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
// Just paste this into linqpad and run | |
var dir = @"C:\my-pictures"; | |
foreach (var cd in Directory.GetDirectories(dir)) { | |
DateTime? lwt = null; | |
foreach (var f in Directory.GetFiles(cd)) { | |
var x = new FileInfo(f).LastWriteTime; | |
if (lwt == null) lwt = x; | |
else if (x < lwt) lwt = x; // < oldest file, > newest file | |
} | |
if (lwt != null) { |
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.Collections.Generic; | |
using System.Linq; | |
using Dargon.Commons; | |
using UnityEngine; | |
using Random = System.Random; | |
public class Quadxels : MonoBehaviour { | |
[SerializeField] private Material lineRendererMaterial; |
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
// 1a: | |
$("pre").innerText.trim().split('\n').map(x => ~~(~~x/3)-2).reduce((a, b) => a+b, 0) | |
// 1b: | |
fuel = (x) => { var f = ~~(~~x/3)-2; return f <= 0 ? 0 : f + fuel(f); } | |
$("pre").innerText.trim().split('\n').map(fuel).reduce((a, b) => a+b, 0) | |
// 2a | |
exec = (ops) => { | |
for (var ip = 0; ip < ops.length; ip += 4) { | |
var op = ops[ip], a0 = ops[ip + 1], a1 = ops[ip + 2], a2 = ops[ip + 3]; |
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
my little... | |
MSG THINGY!!! | |
I am learning c# out of a book so heres my first application.. | |
its really basic.. yet it takes a LOT of instructions... | |
--------------- | |
source code! | |
--------------- | |
using System; | |
using System.Collections.Generic; |
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
# My Incomplete Blog | |
I highly recommend skimming my incomplete [Building a 2D RTS Terrain Engine](https://miyu.gg/blog/building-2d-rts-terrain-engine) - it'll give you the background necessary to follow my stream or roll your own 2D RTS. 😃 | |
# Source Code + Twitter | |
- [OpenMOBA on GitHub](https://github.com/miyu/OpenMOBA) | |
- [@WartyTheNerd on Twitter](https://twitter.com/WartyTheNerd) | |
# Additional Background Reading | |
- Piano Mover's Problem (PMP) |
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.Globalization; | |
using System.Numerics; | |
using System.Runtime.CompilerServices; | |
using System.Runtime.InteropServices; | |
using Microsoft.CodeAnalysis; | |
using static System.Numerics.Vector4; | |
namespace MatrixMultiplicationPerformanceBenchmark { | |
[StructLayout(LayoutKind.Sequential, Pack = 4)] |
NewerOlder