Skip to content

Instantly share code, notes, and snippets.

View evilz's full-sized avatar

Vincent B. evilz

View GitHub Profile
@evilz
evilz / pokerhand.fs
Created September 8, 2017 15:47
Poker Hand Kata
type CardValue =
| Two
| Three
| Four
| Five
| Six
| Seven
| Eight
@evilz
evilz / playNine.css
Created July 4, 2017 13:36
Play Nine in react
#mountNode {
color: #000;
}
.fa-star{
margin: 0.5em;
font-size: 24px;
}
span {
@evilz
evilz / GithubUserCardInfo.js
Created July 4, 2017 06:31
Github User Card Info in react
const Card = (props) => {
return (
<div>
<img width="75" src={props.avatar_url} />
<div style={{display: 'inline-block', marginLeft: 10}}>
<div style={{fontSize: '1.25em', fontWeight: 'bold'}}>{props.name}</div>
<div>{props.company}</div>
</div>
</div>
)
@evilz
evilz / console.vb
Created June 7, 2017 16:02
Console window in VB.net for WINDOWS
Module Module1
Sub Main()
NativeMethods.SetConsoleMode(NativeMethods.GetStdHandle(-11), 1)
Console.BufferWidth = Console.WindowWidth
Console.BufferHeight = Console.WindowHeight
Console.CursorVisible = False
Dim border As New Rectangle(0, 0, Console.WindowWidth, Console.WindowHeight)
Dim title As New Rectangle(0, 0, Console.WindowWidth, 3)
@evilz
evilz / flatMatrix.fs
Created June 2, 2017 16:00
Flat char matrix
open System
open System.Text
let append (sb:StringBuilder) (c:char) = sb.Append(c)
let arrayOfArrays = [| [| 'A'; 'B' |]; [|'X'; 'Y' |] |]
arrayOfArrays
|> Seq.collect String
|> Seq.fold append (StringBuilder())
@evilz
evilz / coderOfTheCaribbean.fs
Created April 24, 2017 07:30
coderOfTheCaribbean.fs
(* Auto-generated code below aims at helping you parse *)
(* the standard input according to the problem statement. *)
open System
open System.Collections.Generic
type EntityId = int
type Orientation =
| Right = 0
| RightTop = 1
| LeftTop = 2
@evilz
evilz / PricingService-csharp7.cs
Last active March 16, 2017 15:37
patternMatching
private static string ComputeRateTableCode(PriceCriteria criteria, BorrowedAmount borrowedAmount, string projectTypeCode)
{
switch (criteria)
{
case PriceCriteria c when c.IsAbTestPricing1():
return RateTable.StandardVar;
case PriceCriteria c when c.IsAbTestPricing2():
return RateTable.ABTestPricing;
@evilz
evilz / colored-grid.js
Created January 26, 2017 14:11
colored-grid using D3
<html>
<head>
<script type="text/javascript" src="http://d3js.org/d3.v3.js"></script>
<!--<script src="d3.min.js" ></script>-->
</head>
<body>
<div id="grid"></div>
</body>
@evilz
evilz / CraDownloader
Created December 17, 2016 10:29
CraDownloader.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
public class CraDownloader
@evilz
evilz / ScheduledTask.ps1
Created November 22, 2016 16:32
ScheduledTask
Function CreateScheduledTask() {
$app = "someApp.exe"
$taskName = "some name"
$trigger = New-ScheduledTaskTrigger -Daily -At 2am
$Sta = New-ScheduledTaskAction -Execute $app
$STPrin = New-ScheduledTaskPrincipal -UserId "LOCALSERVICE" -LogonType ServiceAccount
Register-ScheduledTask -Action $Sta -Principal $STPrin -Trigger $trigger -TaskName $taskName -Description $taskName
}