Skip to content

Instantly share code, notes, and snippets.

View kashmervil's full-sized avatar

Aleksandr Kirsanov kashmervil

  • JetBrains
  • Amsterdam
View GitHub Profile
<div class="container">
@if (true)
{
<article class="post">
<div class="post-cover">
<img src="">
@if (true)
{
<span class="post-featrued-label"></span>
}
package com.jetbrains.rider.ideaInterop.fileTypes.csharp
import com.intellij.lang.Language
import com.intellij.lang.LanguageAnnotators
import com.intellij.lang.annotation.AnnotationHolder
import com.intellij.lang.annotation.Annotator
import com.intellij.openapi.editor.markup.TextAttributes
import com.intellij.psi.PsiElement
import com.intellij.psi.impl.source.tree.LeafPsiElement
import com.intellij.ui.JBColor
ReSharper.UNRESOLVED_ERROR
ReSharper.ERROR
ReSharper.WARNING
ReSharper.SUGGESTION
ReSharper.HINT
ReSharper.COMMENT
ReSharper.KEYWORD
ReSharper.NUMBER
ReSharper.STRING
ReSharper.TEXT
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Security.Cryptography;
using System.Text;
using System.Text.RegularExpressions;
namespace tweet
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Text;
using TweetSharp;
namespace CsharpPoster
{
static class TwitterSettings
{
@kashmervil
kashmervil / agressive_outlining.fs
Created March 10, 2015 16:38
Compiling this takes about 30 sec and generates 45 Mb assembly! Oops
let oops = (<|) (<|) (<|) (<|) (<|) (<|) (<|) (<|) (<|) (<|) (<|) (<|) (<|) (<|) (<|) (<|) (<|) (<|) (<|)
let two = oops (+) 1 1
open System
let L = 14. // Space between wheels || Your values might be quite different
let R = 2.7 // Wheel's radius ||
let ticksPerRotation = 12000. // ~ amount of ticks is taken by one full rotation
let desiredAngle = int ((L/R/4.) * ticksPerRotation) // Math routine to calculate how many ticks is taken to turn
type Direction = Forward | Backward | Left | Right
// <Twitter boilerplate part>
using System;
using System.Collections.Generic;
using System.Linq;
namespace Different
{
class Program
{
private static bool AllDifferent(IEnumerable<int> xs)
{
using System;
using System.Linq;
using System.Collections.Generic;
namespace Merge
{
class Program
{
public static IEnumerable<int> Merge(IEnumerable<int> a, IEnumerable<int> b)
{
data Polynomnom = P [Int]
instance Show Polynomnom where
show (P polynom) =
let showp (P []) = ""
showp (P xs) = nom ++ showp (P (init xs))
where nom
| x == 0 = ""
| x < 0 = "-" ++ show (abs x) ++ temp
| otherwise = "+" ++ (if (x == 1) then "" else (show (abs x))) ++ temp
where x = last xs