THIS DRAFT HAS MOVED TO https://github.com/owickstrom/kashmir.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//----------// | |
// SEMIRING // | |
//----------// | |
// Types that support addition and multiplication. | |
protocol Semiring(a) { | |
add : a -> a -> a | |
zero : a | |
mul : a -> a -> a | |
one : a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(pkg main) | |
(import fmt) | |
;; if expressions | |
(: fib (int -> int)) | |
(def (fib n) | |
(if (== n 1) | |
0 | |
(if (== n 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"fmt" | |
"os" | |
) | |
func main() { | |
syslog, err := os.Open("/var/log/system.log") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gitlab 5.2.0 create user | |
# rake create_user["john@doe.com","johndoe","John Doe"] RAILS_ENV=production | |
desc "Create new user" | |
task :create_user, [:email, :username, :name] => :environment do |t, args| | |
puts "creating user '" + args.username + "' ('" + args.name + "') with email '" + args.email + "'" | |
@user = User.new({ email: args.email, name: args.name, username: args.username, force_random_password: true, projects_limit: 10 }, as: :admin) | |
if @user.save | |
puts "success" | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public virtual IEnumerable<Commit> GetFromTo(DateTime start, DateTime end) | |
{ | |
this.ThrowWhenDisposed(); | |
Logger.Debug(Resources.GettingAllCommitsFromToTime, start, end); | |
var selectedCommitIds = this.stamps.Where(x => x.Value >= start && x.Value < end).Select(x => x.Key); | |
var firstCommitId = selectedCommitIds.FirstOrDefault(); | |
var lastCommitId = selectedCommitIds.LastOrDefault(); | |
if (lastCommitId == Guid.Empty && lastCommitId == Guid.Empty) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(require "minikanren/mk.rkt") | |
(struct e/var (name) #:transparent) | |
(struct e/app (fn param) #:transparent) | |
(struct e/lam (arg body) #:transparent) | |
(define (t/fn domain range) | |
(list ':fn domain range)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Thing | |
{ | |
public long ThingId { get; set; } | |
public string Name { get; set; } | |
public string Description { get; set; } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns scratch.core | |
(:require [clojure.core.typed :as t])) | |
(t/defalias DropboxEntry | |
(t/Rec [x] | |
(t/U '{:type (Value :file) | |
:path String | |
:mime-type String} | |
'{:type (Value :directory) | |
:path String |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"graph": { | |
"label": "Some Title", | |
"metadata": { | |
"id": "uc1" | |
}, | |
"nodes": [ | |
{ | |
"id": "user", | |
"label": "User", |