Skip to content

Instantly share code, notes, and snippets.

@Slesa
Slesa / DoubleClick.cs
Created May 26, 2011
Double click in list views
View DoubleClick.cs
public void Open(UnitRowViewModel viewModel)
{
ScreenManager.ActivateItem(new EditUnitViewModel(viewModel.Id));
}
@Slesa
Slesa / roman.rb
Created Jul 31, 2011
Roman numbers with ruby
View roman.rb
class Roman
»···def self.method_missing name, *args
»···»···roman = name.to_s
»···»···roman.gsub!("IV", "IIII")
»···»···roman.gsub!("IX", "VIIII")
»···»···roman.gsub!("XL", "XXXX")
»···»···roman.gsub!("XC", "LXXXX")
»···»···roman.gsub!("CD", "CCCC")
»···»···roman.gsub!("CM", "DCCCC")
@Slesa
Slesa / spectest.java
Created Apr 24, 2013
Guess my favorite testing framework...
View spectest.java
package specs;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
import dlist.DList;
import dlist.DPosition;
public class When_appending_element {
private DList<Integer> Subject;
@Slesa
Slesa / gist:5899421
Created Jul 1, 2013
A FAKE target for a click once application
View gist:5899421
#I @"Tools\Fake"
#r "FakeLib.dll"
open Fake
let buildNumber =
if hasBuildParam "version" then getBuildParam "version" else
if isLocalBuild then "0" else
buildVersion
let version =
@Slesa
Slesa / FakeMage.fs
Created Jul 9, 2013
Suggestion to support the MAGE tool in FAKE
View FakeMage.fs
type MageProcessor = MSIL | X86
type MageCall = NewApp | UpdateApp | Sign | Deploy | UpdateDeploy | SignDeploy
type MageTrustLevels = Internet | LocalIntranet | FullTrust
type MageParams =
{ ToolsPath : string
ProjectFiles : seq<string>
Name : string
IconPath : string
IconFile : string
Processor : MageProcessor
@Slesa
Slesa / gist:8094334
Created Dec 23, 2013
Compile error in XFCE 4.10
View gist:8094334
Build Configuration:
* Debug Support: full
* GNU Visibility: yes
Now type "make" to compile.
(CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash /home/jpreiss/work/xfce/libxfce4util/missing autoheader)
configure.ac:140: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
../../lib/autoconf/general.m4:2729: _AC_RUN_IFELSE is expanded from...
View gist:b0d51727d056f09766e3
// seq<int64> -> #seq<int64>
let req findAllPrimes values =
let sequence = seq {
for value in values do
if isPrime value then
yield value
else
let divisors = findDivisors value
yield! findAllPrimes divisors }
sequence
View gist:88dd9b4483d02d6df03c
### Keybase proof
I hereby claim:
* I am slesa on github.
* I am slesa (https://keybase.io/slesa) on keybase.
* I have a public key whose fingerprint is 0313 2654 990B FB6A EFF2 6514 AC0E 80D9 FDB6 A2A1
To claim this, I am signing this object:
View Create Zips of apps with data and config
(* Special directory syntax:
bin\Program
bin\Application
...
bin\Config
let deployDir = "bin\deploy\"
let createZip is64bit (dirInfo: DirectoryInfo) =
let dirName = dirInfo.Name
if not (System.String.Equals(dirName, "config", System.StringComparison.CurrentCultureIgnoreCase)) then
@Slesa
Slesa / Main.scala
Created Dec 5, 2020
Scala Hello World
View Main.scala
package hello_scala
import akka.actor.Actor
import akka.actor.ActorSystem
import akka.actor.Props
class HelloActor extends Actor {
def receive = {
case "hello" => println("hello back to you")
case _ => println("huh?")
}