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 * as TE from "fp-ts/lib/TaskEither" | |
import { pipe } from "fp-ts/lib/pipeable" | |
import { Do } from "fp-ts-contrib/lib/Do" | |
type Error1 = { errors: object[]; type: "1" } | |
type Error2 = { errors: object[]; response: Response; type: "2" } | |
type Error3 = { errors: object[]; result: unknown; type: "3" } | |
type Errors = Error1 | Error2 | Error3 | |
export const post = (url: string, body: object) => |
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 scala.annotation.tailrec | |
object ShittySolution { | |
// Given an array of integers, return indices of the two numbers such that they add up to a specific target. | |
// | |
// You may assume that each input would have exactly one solution, and you may not use the same element twice. | |
// https://leetcode.com/problems/two-sum/ | |
// NB: More efficient solution would iterate once over the array and keep a Map of values and indicies | |
def twoSum(nums: Array[Int], target: Int): Array[Int] = { |
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 abstract class BaseHub : Hub | |
{ | |
public EventHandler Disposing; | |
bool _disposed; | |
protected override void Dispose(bool disposing) { | |
if (_disposed) | |
return; | |
_disposed = true; |
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
// this script checks if there arent too many magazines or respawns according to available slots | |
_count = count (configFile >> "CfgVehicles"); | |
_prefix = "t1o_"; | |
_vehicleName = ""; | |
_singleError = false; | |
// Remove this | |
_msg = format["_count: %1", _count]; | |
diag_log [diag_frameNo, diag_tickTime, time, _msg]; |
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
#!/usr/bin/env ruby | |
# Usage: | |
# ruby plugin_to_gem.rb my_plugin_directory | |
require 'fileutils' | |
@plugin_dir = ARGV[0] | |
@plugin_name = File.basename ARGV[0] | |
def rakefile_content | |
description = 'TODO' |