Skip to content

Instantly share code, notes, and snippets.

@facemao3
facemao3 / PackageApplication
Created June 20, 2019 06:46
PackageApplication script from Xcode 8.2.1
#!/usr/bin/perl
#
# PackageApplication
#
# Copyright (c) 2009-2012 Apple Inc. All rights reserved.
#
# Package an iPhone Application into an .ipa wrapper
#
use Pod::Usage;
@facemao3
facemao3 / ecs.md
Created December 15, 2018 03:36 — forked from paniq/ecs.md
Entity Component Systems
@facemao3
facemao3 / PingAsync.cs
Created March 17, 2017 09:31 — forked from guitarrapc/PingAsync.cs
Asynchronous Ping/DNSResolver by C#. Also PowerShell OnTheFly compile Asynchronous Ping
void Main()
{
var computerName = Enumerable.Range(1, 250).Select(x => "192.10.10." + x).ToArray();
// var computerName = Util.Cache(() => Enumerable.Range(1, 254).SelectMany(i => Enumerable.Range(10, 4).SelectMany(j => new[] { $"192.10.{j}.{i}" })).ToArray());
var sw = Stopwatch.StartNew();
NetworkInformationExtensions.PingAsync(computerName, TimeSpan.FromMilliseconds(1), false).Result.Where(x => x.Status == IPStatus.Success);
sw.Elapsed.TotalMilliseconds.Dump("Resolve = false, PingTimeout = 1");
sw.Restart();
@facemao3
facemao3 / ocean_frag.glsl
Created February 18, 2017 10:19
Seascape shader from ShaderToy(https://www.shadertoy.com/view/Ms2SD1) adapted to Haxe Kha
// "Seascape" by Alexander Alekseev aka TDM - 2014
// Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
// Adapted to Haxe Kha by Lubos Lenco
#ifdef GL_ES
precision mediump float;
#endif
uniform float globalTime;
@facemao3
facemao3 / FlowMap.shader
Created February 18, 2017 08:00 — forked from TarasOsiris/FlowMap.shader
Flow Map Shader for Unity3D. Used with Sprites.
Shader "Custom/Flow Map"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
// Flow
_FlowMap ("Flow Map", 2D) = "white" {}
_FlowSpeed ("Flow Speed", float) = 0.05
@facemao3
facemao3 / optimizations.md
Created January 21, 2016 03:22 — forked from mandarinx/optimizations.md
Unity3D optimization tips

#Unity3D optimization tips

Some code allocates memory when running in the editor and not on the device. This is due to Unity doing some extra error handling so possible error messages can be output in the console. Much of this code is stripped during build. It's therefore important to profile on device, and do it regularly.

Optimizations often makes code more rigid and harder to reason. Don't do it until you really need to.

When profiling, wrap methods or portions of a method in Profiler.BeginSample(string name) and Profiler.EndSample() to make them easier to find in the profiler.

public class SomeClass {
@facemao3
facemao3 / linkmap.js
Last active August 29, 2015 14:27 — forked from bang590/linkmap.js
XCode Linkmap Parser
var readline = require('readline'),
fs = require('fs');
var LinkMap = function(filePath) {
this.files = []
this.filePath = filePath
}
LinkMap.prototype = {
start: function(cb) {
@facemao3
facemao3 / WWWClient.cs
Last active April 18, 2023 02:37 — forked from cloned/WWWClient.cs
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
namespace WWWKit
{
/// <summary>
/// A handy class to use WWW class and WWWForm class.
///
/// Features:
@facemao3
facemao3 / md5.cs
Last active April 18, 2023 02:38 — forked from atifaziz/md5.cs
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
static class Program
{
static void Run(IEnumerable<string> args)