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
{ | |
"schools": [ | |
{ | |
"name": "BYU", | |
"majors": [ | |
{ | |
"avgGradIncome": 47933.83985587071, | |
"avgIncome": 80235.65865481534, | |
"creditHours": 70.52513178928457, | |
"departments": [ |
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
#include <iostream> | |
using namespace std; | |
#define Q(a, b) ([&](){ auto val = (a); if (val) (val->b); }()); | |
#define QQ(a, b) ([&](){ auto val = (a); return ((val) == NULL ? (b) : (val)); }()) | |
class A { | |
public: void sayHello() { cout << "Hello World\n"; } | |
}; |
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.Threading; | |
using System.Threading.Tasks; | |
namespace AsyncChallenge | |
{ | |
internal class Program | |
{ | |
// Comment in the async or sync version to try to get the program to print out: | |
// EVIL |
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
from random import randint | |
club = u'\u2663' | |
diamond = u'\u2666' | |
heart = u'\u2665' | |
spade = u'\u2660' | |
card_suits = [club, diamond, heart, spade] | |
card_values = [ |
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 sealed class ExampleEnumeration : Enumeration<ExampleEnumeration, string> | |
{ | |
public static readonly ExampleEnumeration Value = new ExampleEnumeration(nameof(Value)); | |
public static readonly ExampleEnumeration Value2 = new ExampleEnumeration(nameof(Value2), "Value 2"); | |
private ExampleEnumeration(string value, string name = null) : base(value, name ?? value) {} | |
} | |
/// <summary> | |
/// Enumeration representation that can take all types |
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; | |
using Newtonsoft.Json; | |
public sealed class ExampleEnum : StringEnumeration<ExampleEnum> | |
{ | |
public static readonly ExampleEnum Value1 = new ExampleEnum(nameof(Value1)); | |
public static readonly ExampleEnum Value2 = new ExampleEnum(nameof(Value2)); | |
public static readonly ExampleEnum Value3 = new ExampleEnum(nameof(Value3)); |
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
// Use like so: | |
// Console.WriteLine("hello".If(s => s.length == 5, s => s + " world")); | |
// var newObj = someObj.If(null, new Foo(), o => o.bar()); | |
// return response | |
// .If(r => r?.Content == null, "", r => r.Content.ReadAsStringAsync().Response) | |
// .If(string.IsNullOrWhiteSpace, "", content => $"----\n\t{content}\n----") | |
namespace FuncIf | |
{ | |
public static class FuncIfExtensions | |
{ |
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
tool | |
extends CollisionShape2D | |
export var draw := false setget set_draw | |
func set_draw( value :bool ) -> void: | |
draw = value | |
update() | |
export var color := Color.white setget set_color | |
func set_color( value :Color ) -> void: |
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
# Singleton Time | |
extends Node | |
## | |
# Set this class as a singleton in Godot named Time or similar. | |
# Setting it near the top will ensure it is processed before | |
# everything else, giving you consistent values for all nodes | |
# that use this class. | |
# this class has a global process and physics process count | |
# that is very useful when doing things less often. | |
# A wrapper has provided to make that even quicker: |
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.Linq; | |
using Godot; | |
using Godot.Collections; | |
namespace Vial.Export { | |
[System.AttributeUsage(System.AttributeTargets.Property, Inherited = false, AllowMultiple = true)] | |
public sealed class ExportAsAttribute : System.Attribute { |
OlderNewer