Skip to content

Instantly share code, notes, and snippets.

View Cynede's full-sized avatar
🕸️

ミーゼこちゃん Cynede

🕸️
View GitHub Profile
@simonmichael
simonmichael / gist:1185421
Created September 1, 2011 03:59
ghc-pkg-clean, ghc-pkg-reset
# unregister broken GHC packages. Run this a few times to resolve dependency rot in installed packages.
# ghc-pkg-clean -f cabal/dev/packages*.conf also works.
function ghc-pkg-clean() {
for p in `ghc-pkg check $* 2>&1 | grep problems | awk '{print $6}' | sed -e 's/:$//'`
do
echo unregistering $p; ghc-pkg $* unregister $p
done
}
# remove all installed GHC/cabal packages, leaving ~/.cabal binaries and docs in place.
@ckirkendall
ckirkendall / clojure-match.clj
Created June 15, 2012 02:26 — forked from bkyrlach/Expression.fs
Language Compare F#, Ocaml, Scala, Clojure, Ruby and Haskell - Simple AST example
(use '[clojure.core.match :only [match]])
(defn evaluate [env [sym x y]]
(match [sym]
['Number] x
['Add] (+ (evaluate env x) (evaluate env y))
['Multiply] (* (evaluate env x) (evaluate env y))
['Variable] (env x)))
(def environment {"a" 3, "b" 4, "c" 5})
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active November 8, 2025 03:28
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@michael-newton-15below
michael-newton-15below / GrabNugets.fsx
Created November 20, 2012 15:07
Nuget.Core example
#r "Nuget.Core"
#r "System.Xml.Linq"
open NuGet
open System
open System.Linq
let repoFac = new PackageRepositoryFactory()
let repo = repoFac.CreateRepository("http://btn-tc01:8083")
let FiveFiveVersion = new SemanticVersion("5.5.0")
let packages = repo.FindPackages("Database.PASNGR", new VersionSpec(), false, false)
@Cynede
Cynede / gist:4283489
Created December 14, 2012 07:47
F# 3.0 FROM THE BOX ON GENTOO
App.config TeAI.fs TeAIChess.fsproj TeAIConsole.fs TeAIHelpers.fs TeAIModel.fs
>>xbuild TeAIChess.fsproj ~/contrib/fchess/src/ :)
XBuild Engine Version 3.0.1.0
Mono, Version 3.0.1.0
Copyright (C) Marek Sieradzki 2005-2008, Novell 2008-2011.
Build started 12/14/2012 11:46:26.
__________________________________________________
Project "/home/nen/contrib/fchess/src/TeAIChess.fsproj" (default target(s)):
Target PrepareForBuild:
@Cynede
Cynede / gist:4492036
Created January 9, 2013 10:02
F# FAKE is taking action in Gentoo ecosystem
>> Emerging (1 of 1) dev-dotnet/fchess-9999 from weirdo
>>> Unpacking source...
remote: Counting objects: 9, done.
remote: Compressing objects: 100% (1/1), done.
remote: Total 5 (delta 4), reused 5 (delta 4)
Unpacking objects: 100% (5/5), done.
From git://github.com/Cynede/FChess
d997552..70a4f9b master -> master
GIT update -->
repository: git://github.com/Cynede/FChess.git
@Cynede
Cynede / gist:4509874
Last active December 10, 2015 23:28
Gentoo Haskell F#
>>time ./hs 15 ~/tests/ :)
stretch tree of depth 16 check: -1
65536 trees of depth 4 check: -65536
16384 trees of depth 6 check: -16384
4096 trees of depth 8 check: -4096
1024 trees of depth 10 check: -1024
256 trees of depth 12 check: -256
64 trees of depth 14 check: -64
long lived tree of depth 15 check: -1
./hs 15 1.08s user 0.72s system 99% cpu 1.803 total
@rblaze
rblaze / bf.c
Last active December 11, 2015 07:08
Специальная олимпиада-2: Bellman-Ford algorithm как первый шаг Johnson algorithm Изначальная версия: haskell - 60 минут, C - две минуты. Данные для обработки: http://spark-public.s3.amazonaws.com/algo2/datasets/large.txt
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
const int infinity = 2147483647;
struct edge_t {
int v1;
int v2;
int cost;
@leppie
leppie / gist:5081390
Created March 4, 2013 10:34
Roslyn stuff
var ast = SyntaxTree.ParseText(@"
namespace Foo {
#define MyIf = if
#define MyElse = else
public class some
{
public void someMethod()
{
MyFor(int i = 0; i < 10; i++)
@leppie
leppie / gist:5293332
Created April 2, 2013 15:53
Scheme Unicode identifiers
private static bool IsLetterOrUnicodeSchemeIdentifier(char num)
{
if (num < '\x0080')
{
return char.IsLetter(num);
}
switch (char.GetUnicodeCategory(num))
{
case UnicodeCategory.UppercaseLetter:
case UnicodeCategory.LowercaseLetter: