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
import UIKit | |
import AVFoundation | |
open class VideoPreview : UIViewController { | |
var captureSession: AVCaptureSession! | |
var camera: AVCaptureDevice! | |
var preview: AVCaptureVideoPreviewLayer! | |
func initSession() { |
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
2018-12-20 22:46:18 [log] [PhilipsHueApp] Philips Hue app initiating... | |
2018-12-20 22:46:21 [log] [ManagerDrivers] [LCT012] [0] ZigBeeDevice has been inited | |
2018-12-20 22:46:21 [log] [ManagerDrivers] [LCT012] [0] ------------------------------------------ | |
2018-12-20 22:46:21 [log] [ManagerDrivers] [LCT012] [0] Node: 68ea17ae-a624-4046-8f03-cfb76517405d | |
2018-12-20 22:46:21 [log] [ManagerDrivers] [LCT012] [0] - Battery: false | |
2018-12-20 22:46:21 [log] [ManagerDrivers] [LCT012] [0] - Endpoints: 0 | |
2018-12-20 22:46:21 [log] [ManagerDrivers] [LCT012] [0] -- Clusters: | |
2018-12-20 22:46:21 [log] [ManagerDrivers] [LCT012] [0] --- 64513 | |
2018-12-20 22:46:21 [log] [ManagerDrivers] [LCT012] [0] ---- cid : 64513 | |
2018-12-20 22:46:21 [log] [ManagerDrivers] [LCT012] [0] ---- sid : attrs |
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; | |
using System.Collections.Generic; | |
using System.Linq; | |
public static class Program | |
{ | |
public static void Main() | |
{ | |
// syntax is: patch,patch,patch | |
// where patch is: LETTER PRIO BEFORE AFTER |
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; | |
using System.Reflection; | |
public static class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
try | |
{ | |
// run original |
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; | |
public static class Program { | |
public static void Main() { | |
Console.WriteLine(DynamicHarmonyWrapper()); | |
} | |
public static string DynamicHarmonyWrapper() { | |
string result = default; |
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 HarmonyLib; | |
using NUnit.Framework; | |
using System; | |
using System.Reflection; | |
using System.Reflection.Emit; | |
namespace HarmonyLibTests | |
{ | |
[TestFixture] | |
public class TestMethodBuilder |
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 Harmony; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reflection; | |
using System.Reflection.Emit; | |
namespace HarmonyLibTests.IL | |
{ |
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 Harmony; | |
using System.Reflection; | |
using UnityEngine; | |
using Verse; | |
namespace Test | |
{ | |
class TestMod : Mod | |
{ | |
public TestMod(ModContentPack content) : base(content) |
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 MultiPatchInfo | |
{ | |
public MethodBase original; | |
public MethodInfo replaceFrom; | |
public MethodInfo replaceTo; | |
public Func<IEnumerable<CodeInstruction>, IEnumerable<CodeInstruction>> argumentCodes; | |
public MultiPatchInfo(MethodBase original, MethodInfo replaceFrom, MethodInfo replaceTo, params CodeInstruction[] instructions) | |
{ | |
this.original = original; |
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
import SwiftUI | |
class Person: Hashable { | |
var uuid = UUID().uuidString | |
var name: String = "" | |
var toys: [Toy] | |
init(name: String, _ toys: Toy...) { | |
self.name = name |