Skip to content

Instantly share code, notes, and snippets.

using System;
namespace ConsoleApplication1.FunctionSuite
{
public static class Functions
{
public static Func<T1, TResult> FunctionSuite<T1, T2, TResult>(Func<T1, T2> f1, Func<T2, TResult> f2)
{
return t1 =>
{
@FaustVX
FaustVX / Program.cs
Created April 7, 2015 20:05
TuringMachine
public static class Program
{
private static void Main(string[] args)
{
var machine1 = new UniversalMachine(new[] {'0', '1'},
new[] {"Mov", "B", "Bi", "OK"},
new[]
{
"Mov 0 = Mov 0 >",
"Mov 1 = Mov 1 >",
using System;
using System.Collections.Generic;
namespace HouseNumber
{
public static class HouseNumber
{
private static void Main()
{
var fore = Console.ForegroundColor;
public static class NumberOnlyBehaviour
{
public static readonly DependencyProperty IsEnabledProperty =
DependencyProperty.RegisterAttached("IsEnabled", typeof(bool),
typeof(NumberOnlyBehaviour), new UIPropertyMetadata(false, OnValueChanged));
public static bool GetIsEnabled(Control o)
{
return (bool)o.GetValue(IsEnabledProperty);
}
@FaustVX
FaustVX / ExcelMacros.bas
Created September 20, 2018 08:23
Excel Macros
Public Sub FormulaToValue()
ActiveCell.Formula = ActiveCell.Value
End Sub
@FaustVX
FaustVX / backupDisk.fish
Last active September 15, 2020 21:47
Fish shell functions
function backupDisk --argument disk file
if sudo dd if=$disk bs=4M conv=fsync status=progress | gzip -v9 | sudo dd of=$file.new
mv $file.new $file
end
end
# run each tick 'execute as @e[] run namespace:detect_moving_entity'
# then execute as @e[tag=takeoff] ...
# the `flying` tag is present even in `takeoff` and `landing` phases
tag @s[tag=flying, tag=landing] remove flying
tag @s[tag=landing] remove landing
tag @s[tag=flying, tag=!landing, nbt={Motion:[0d,0d,0d], OnGround:true}] add landing
tag @s[tag=takeoff] remove takeoff
@FaustVX
FaustVX / winget.json
Last active April 3, 2022 15:26
Default Winget Apps
{
"$schema" : "https://aka.ms/winget-packages.schema.2.0.json",
"CreationDate" : "2022-02-07T01:56:18.924-00:00",
"Sources" :
[
{
"Packages" :
[
{
"PackageIdentifier" : "Google.Chrome"
@FaustVX
FaustVX / configs.code-workspace
Last active July 21, 2022 17:52
MC Save workspace
{
"folders": [
{
"path": ".\\serverconfig"
},
{
"path": "..\\..\\config"
},
{
"path": "..\\..\\defaultconfigs"