This file contains hidden or 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
var floatToStringPipe = new FuncPipe<float, string>(f => $"Given {f}") | |
.Then(new FuncPipe<string, int>(f => f.Length)) | |
.Then(new FuncPipe<int, string>(f => String.Join(String.Empty, Enumerable.Range(1, f + 1)))); | |
var result = floatToStringPipe.Execute(3.14f); // float, string | |
Console.WriteLine(result); | |
// 1234567891011 | |
var toBoldAndItalic = new ToHtmlBoldPipe().Then(new ToHtmlUnderlinePipe()); |
This file contains hidden or 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
// Simple URI parser with ANTLR4 | |
// Omer Faruk Zorlu, Jun 2021 | |
grammar URI; | |
prog : (segment)+ ; | |
segment : protocol? host path? ; | |
protocol : VALID_CHARSET+ PROTOCOL_DELIMITER ; | |
host : VALID_CHARSET+ ~'/'? ; | |
path : (VALID_CHARSET | PATH_DELIMITER)+ query? ; | |
query : VALID_CHARSET? QUERY_DELIMITER query_name_value ; |
This file contains hidden or 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
$fn = 60; | |
node_radius = 3; | |
node_bar_height = 16; | |
nodes = [40, 50]; | |
node_height = 3; | |
bend_padding = 4; | |
bend_height = 1.5; | |
bend_angle = -5; |
This file contains hidden or 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 static class ServiceCollectionExtensions | |
{ | |
private static MethodInfo _method; | |
public static void ConfigureTypeNamed<T>(this ServiceCollection serviceCollection, IConfigurationRoot configuration) | |
=> ConfigureTypeNamed(serviceCollection, configuration, typeof(T)); | |
public static void ConfigureTypeNamed(this ServiceCollection serviceCollection, IConfigurationRoot configuration, Type type) | |
{ | |
if (_method == null) |
This file contains hidden or 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
namespace Mapping | |
{ | |
public class Mapper | |
{ | |
private Configuration _configuration; | |
public Mapper(Configuration configuration) | |
{ | |
_configuration = configuration; | |
} |
This file contains hidden or 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.Globalization; | |
using System.Linq; | |
namespace LocalizationDemo | |
{ | |
class Program | |
{ | |
static void Main(string[] args) |
This file contains hidden or 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
$response = (curl "http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types") | |
$headerPassed = $False | |
ForEach ($line in $($response.Content -split '[\r\n]')) { | |
if ($headerPassed -eq $False) { | |
$headerPassed = $line.StartsWith("# =") | |
continue | |
} | |
else | |
{ |
This file contains hidden or 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.IO; | |
using System.Text; | |
using System.Linq; | |
using Newtonsoft.Json; | |
using Newtonsoft.Json.Linq; | |
namespace jnbug | |
{ |
This file contains hidden or 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 | |
class MySegueBase: UIStoryboardSegue | |
{ | |
open func getDestinationFromPosition(viewFrameSize : CGSize!) -> CGAffineTransform { | |
return CGAffineTransform(translationX: 2*source.view.frame.size.width, y: 0); | |
} | |
open func getSourceTargetPositon(viewFrameSize : CGSize!) -> CGAffineTransform { | |
return CGAffineTransform(translationX: -viewFrameSize.width, y: 0); |
This file contains hidden or 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 AutoMapper; | |
namespace pp | |
{ | |
class MainClass | |
{ | |
public static void Main (string [] args) | |
{ | |
Mapper.Initialize ((obj) => obj.AddProfile<MyProfile> ()); |
NewerOlder