Skip to content

Instantly share code, notes, and snippets.

View paulkoerbitz's full-sized avatar

Paul Koerbitz paulkoerbitz

View GitHub Profile
with import <nixpkgs> {};
let wlc = import ./wlc.nix pkgs;
in
stdenv.mkDerivation {
name = "swaywm-0.1";
src = fetchgit {
url = https://github.com/SirCmpwn/sway.git;
rev = "adf5b8fed70b3b61e67f16c3bec4a9b25d8ec831";
@paulkoerbitz
paulkoerbitz / fiddle.ts
Last active December 12, 2023 15:03
Trying to use React.js with TypeScript and the definitions from definitely typed
/// <reference path="react-0.13.0.d.ts"/>
import React = require('react');
var RD = React.DOM;
enum ElementType { A, B, C }
interface NameTypeI {name: string; type: ElementType;}
interface CallbackI { newNode: (x: NameTypeI) => void; }
class NewNode extends React.Component<CallbackI,{},{}> {
constructor(props: CallbackI, context: {}) {
@paulkoerbitz
paulkoerbitz / default.nix
Created January 13, 2015 07:24
Attempt at creating a default.nix for building Idris (with mtl_2_2_1)
# Set the variable NIX_PATH to point to the directory where you've cloned the
# nixpkgs repository. Then you can run one of two commands:
#
# nix-build -A crashEnv
#
# This puts a script called 'load-env-crashEnv' into ./result/bin. Running
# that script puts you into a shell where you can use all of the crash-related
# binaries.
#
# nix-shell -A crash.safeIsa
module Main where
main :: IO ()
main = putStrLn "Hello, world!"
pkgs : {
allowUnfree = true;
packageOverrides = self : rec {
oraclejdk7 = self.callPackage ./oraclejdk/jdk7-linux.nix { installjdk = true; };
};
}
data Lit = Lit Int
data Add l r = Add l r
class Eval x where
eval :: x -> Int
instance Eval Lit where
eval (Lit x) = x
instance (Eval l, Eval r) => Eval (Add l r) where
@paulkoerbitz
paulkoerbitz / Printf.idr
Created April 25, 2014 08:09
printf with totality problem
module Main
%default total
data Format = End
| FInt Nat Format
| FStr Nat Format
| FChar Char Format
data Digit : Char -> Type where
module Main
ex1 : IO ()
ex1 = do
let s = "Hello, "
putStrLn $ s ++ ", world!"
main : IO ()
main = do
putStrLn "Hello, "
@paulkoerbitz
paulkoerbitz / tutorial1.clj
Created October 18, 2011 11:35
Simple webscrape with enlive
(ns tutorial.scrape1
(:require [net.cgrand.enlive-html :as html]))
(def *url* "http://www.belex.rs/trgovanje/prospekt/VZAS/show")
(defn get-page
"Gets the html page from passed url"
[url]
(html/html-resource (java.net.URL. url)))