Skip to content

Instantly share code, notes, and snippets.

View Porges's full-sized avatar
🏠
Working from home

George Pollard Porges

🏠
Working from home
View GitHub Profile
@terrajobst
terrajobst / SplitByNamespace.cs
Created July 10, 2018 23:36
Split files by namespace
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Text;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace NetStandardCleanup
@Porges
Porges / program.cs
Created January 16, 2017 22:33
fun with StartsWith
using System;
namespace UnicodeRulez
{
class Program
{
static void Main()
{
Console.WriteLine("Cheese".StartsWith("C­͏͸͹Ϳ΀΁΂΃΋΍΢ԤԥԨԩԪԫԬԭԮԯ԰՗՘ՠֈ֋֌֍֎֏֐׈׉׊׋׌׍׎׏׫׬׭׮ׯ׵׶׷׸׹׺׻׼׽׾׿؄؅؜؝ـ܎݋݌޲޳޴޵޶޷޸޹޺޻޼޽޾޿߻߼߽߾߿࠮࠯࠿࡜࡝࡟ࡠࡡࡢࡣࡤࡥࡦࡧࡨࡩࡪ࡫࡬࡭࡮࡯ࡰࡱࡲࡳࡴࡵࡶࡷࡸࡹࡺࡻࡼࡽࡾࡿࢀࢁࢂࢃࢄࢅࢆࢇ࢈ࢉࢊࢋࢌࢍࢎ࢏࢐࢑࢒࢓࢔࢕࢖࢙࢚࢛ࢗ࢘࢜࢝࢞࢟ࢠࢡࢢࢣࢤࢥࢦࢧࢨࢩࢪࢫࢬࢭࢮࢯࢰࢱࢲࢳࢴࢵࢶࢷࢸࢹࢺࢻࢼࢽࢾࢿࣀࣁࣂࣃࣄࣅࣆࣇࣈࣉ࣏࣐࣑࣒࣓࣊࣋࣌࣍࣎ࣔࣕࣖࣗࣘࣙࣚࣛࣜࣝࣞࣟ࣠࣡࣢ࣰࣱࣲࣣࣦࣩ࣭࣮࣯ࣶࣹࣺࣤࣥࣧࣨ࣪࣫࣬ࣳࣴࣵࣷࣸࣻࣼࣽࣾࣿऀॸঀ঄঍঎঑঒঩঱঳঴঵঺঻৅৆৉৊৏৐৑৒৓৔৕৖৘৙৚৛৞৤৥৻ৼ৽৾৿਀਄਋਌਍਎਑਒਩਱਴਷਺਻਽੃੄੅੆੉੊੎੏੐੒੓੔੕੖੗੘੝੟੠੡੢੣੤੥੶੷੸੹੺੻੼੽੾੿઀઄઎઒઩઱઴઺઻૆૊૎૏૑૒૓૔૕૖૗૘૙૚૛૜૝૞૟૤૥૰૲૳૴૵૶૷૸ૹૺૻૼ૽૾૿଀଄଍଎଑଒଩଱଴଺଻୅୆୉୊୎୏୐୑୒୓୔୕୘୙୚୛୞୤୥୸୹୺୻୼୽୾୿஀஁஄஋஌஍஑஖஗஘஛஝஠஡஢஥஦஧஫஬஭஺஻஼஽௃௄௅௉௎௏௑௒௓௔௕௖௘௙௚௛௜௝௞௟௠௡௢௣௤௥௻௼௽௾௿ఀఄ఍఑఩ఴ఺఻఼౅౉౎౏౐౑౒౓౔౗ౚ౛౜ౝ౞౟౤౥౰౱౲౳౴౵౶౷ಀಁ಄಍಑಩಴಺಻೅೉೎೏೐೑೒೓೔೗೘೙೚೛೜ೝ೟೤೥೰ೳ೴೵೶೷೸೹೺೻೼೽೾೿ഀഁഄ഍഑഻഼൅൉൏൐൑൒൓ൔൕൖ൘൙൚൛൜൝൞ൟ൤൥൶൷൸඀ඁ඄඗඘඙඲඼඾඿෇෈෉෋෌෍෎෕෗෠෡෢෣෤෥෦෧෨෩෪෫෬෭෮෯෰෱෵෶෷෸෹෺෻෼෽෾෿฀฻฼฽฾๜๝๞๟๠๡๢๣๤๥๦๧๨๩๪๫๬๭๮๯๰๱๲๳๴๵๶๷๸๹๺๻๼๽๾๿຀຃຅ຆຉ຋ຌຎຏຐຑຒຓຘຠ຤຦ຨຩຬ຺຾຿໅໇໌໎໏໚໛ໞໟ໠໡໢໣໤໥໦໧໨໩໪໫໬໭໮໯໰໱໲໳໴໵໶໷໸໹໺໻໼໽໾໿཈཭཮཯཰྘྽࿍࿛࿜࿝࿞࿟࿠࿡࿢࿣࿤࿥࿦࿧࿨࿩࿪࿫࿬࿭࿮࿯࿰࿱࿲࿳࿴࿵࿶࿷࿸࿹࿺࿻࿼࿽࿾࿿჆Ⴧ჈჉჊჋჌Ⴭ჎჏ჽჾჿ቉቎቏቗቙቞቟኉኎኏኱኶኷኿዁዆዇዗጑጖጗፛፜፽፾፿᎚᎛᎜᎝᎞᎟Ᏽ᏶᏷ᏸᏹᏺᏻᏼᏽ᏾᏿᚝᚞᚟ᛱᛲᛳᛴᛵᛶᛷᛸ᛹᛺᛻᛼᛽᛾᛿ᜍ᜕᜖᜗᜘᜙᜚᜛᜜᜝᜞ᜟ᜷᜸᜹
@Shamrock-Frost
Shamrock-Frost / HyperOperations.hs
Created June 24, 2016 07:19
Halle told me about an interview question at Microsoft, and I joked I'd solve it monoidally. I wasn't joking, Halle.
import Data.Monoid hiding (Sum)
class Monoid a => IntWrapper a where toInt :: a -> Int
newtype Sum = Sum Int deriving (Show, Eq)
instance IntWrapper Sum where toInt (Sum n) = n
instance Monoid Sum where
mempty = Sum 0
mappend (Sum a) (Sum b) = Sum (a + b)
@puffnfresh
puffnfresh / Monoid.v
Created April 24, 2014 15:08
Verified monoid in Coq.
Inductive bool : Type :=
| true : bool
| false : bool.
Class Monoid (A : Type) :=
{
empty : A ;
append : A -> A -> A ;
left_neutrality : forall x, append empty x = x ;
^(?'xmlDecl'<\?xml(?'versionInfo'([\u0020\u0009\u000d\u000a]+)version(?'eq'([\u0
020\u0009\u000d\u000a]+)?=([\u0020\u0009\u000d\u000a]+)?)('1\.[0-9]+'|"1\.[0-9]+
"))(?'encodingDecl'([\u0020\u0009\u000d\u000a]+)encoding(?'eq'([\u0020\u0009\u00
0d\u000a]+)?=([\u0020\u0009\u000d\u000a]+)?)("(?'encName'[A-Za-z][A-Za-z0-9._-]*
)"|'(?'encName'[A-Za-z][A-Za-z0-9._-]*)'))?(?'sddecl'([\u0020\u0009\u000d\u000a]
+)standalone(?'eq'([\u0020\u0009\u000d\u000a]+)?=([\u0020\u0009\u000d\u000a]+)?)
("(yes|no)"|'(yes|no)'))?([\u0020\u0009\u000d\u000a]+)?\?>)?(?'misc'(?'comment'<
!--((?!--)([\u0009\u000a\u000d\u0020-\ud7ff\ue000-\ufffd]|([\ud800-\udbff][\udc0
0-\udfff])))*-->)|(?'PI'<\?(?'pitarget'(?![xX][mM][lL])(?'name'([:A-Z_a-z\u00C0-
\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u
@laanwj
laanwj / haskell-unicode.sublime-keymap
Created September 22, 2012 13:35
Haskell unicode syntax key bindings for Sublime Text 2
[
{ "keys": [":",":"], "command": "insert_snippet", "args": {"contents": "∷"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "source.haskell" }
]
},
{ "keys": ["-",">"], "command": "insert_snippet", "args": {"contents": "→"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "source.haskell" }
]
--- git-rebase--interactive.old 2011-06-11 13:17:48.000000000 +0400
+++ git-rebase--interactive 2012-04-17 12:44:09.000000000 +0400
@@ -951,7 +951,7 @@
REVISIONS=$ONTO...$HEAD
SHORTREVISIONS=$SHORTHEAD
fi
- git rev-list $MERGES_OPTION --pretty=oneline --abbrev-commit \
+ git rev-list $merges_option --pretty=">%h (%an <%ae>) %s"\
--abbrev=7 --reverse --left-right --topo-order \
$REVISIONS | \