Skip to content

Instantly share code, notes, and snippets.

View Glut.hs
import System.Exit (exitWith, ExitCode(ExitSuccess))
import Graphics.UI.GLUT
main = do
(progName, _args) <- getArgsAndInitialize
initialDisplayMode $= [ SingleBuffered, RGBMode ]
initialWindowSize $= Size 500 500
_ <- createWindow progName
exitWith ExitSuccess
@cleverca22
cleverca22 / default.nix
Created Aug 28, 2019 — forked from idontgetoutmuch/default.nix
pkg config generation
View default.nix
{ stdenv, fetchurl, gfortran }:
stdenv.mkDerivation rec {
name = "blas-${version}";
version = "3.8.0";
src = fetchurl {
url = "http://www.netlib.org/blas/${name}.tgz";
sha256 = "1s24iry5197pskml4iygasw196bdhplj0jmbsb9jhabcjqj2mpsm";
};
View default.nix
{ pkgs ? import ./nix/nixpkgs.nix {} }:
with pkgs;
haskellPackages.extend (self: super: {
polysemy = self.callHackageDirect {
pkg = "polysemy";
ver = "1.1.0.0";
sha256 = "1krbhfs6sr9m6nxhs9ygkblwd85w234hll5g7ndzhdwy5pfbyfvm";
} {};
View default.nix
self: super:
let
pythonOverlay = pself: psuper:
{
sundials_3_lapack = pself.callPackage ./pkgs/sundials { };
myScikits-odes = pself.callPackage ./pkgs/scikits-odes { };
};
in {
pythonPackages = super.pythonPackages.override { overrides = pythonOverlay; };
}
View default.nix
# in rails project
with (import <nixpkgs> {});
let
rubyenv = bundlerEnv {
name = "cart-env";
# Setup for ruby gems using bundix generated gemset.nix
inherit ruby_2_6;
gemfile = ./Gemfile;
View nix-repl
nix-repl> eval = import <nixpkgs/nixos> { configuration = ./snmpd.nix; }
nix-repl> eval.config.systemd.units."snmpd.service".unit
«derivation /nix/store/q8nq58244hw0v04w400kzwllxwb42zrg-unit-snmpd.service.drv»
View random notes on profiling.md

attrset ? "key" and attrset.key or fallback have nearly equal complexity costs

if attrset ? "key" then attrset.key else fallback is slightly more expensive,

due to being 3 AST nodes (an ExprIf with an ExprOpHasAttr as the condition and then an ExprSelect to extract the "key")

attrset.key or fallback is slightly cheaper, since it is a single AST node (just ExprSelect)

View furnace IC.txt
start:
alias FlushSwitch d0
alias FlushRegulator d1
alias Furnace d2
alias FillSwitch d3
alias FillRegulator d4
loop:
l r0 FillSwitch Open
s FillRegulator On r0
l r0 FlushSwitch Open
View custom-alarm.nix
{ fetchFromGitHub }:
fetchFromGitHub {
owner = "gazoscalvertos";
repo = "Hass-Custom-Alarm";
rev = "v1.3.1";
sha256 = "1xlwsyg45kmvx3gvkv7k5imbhkxan0s573lalkcqcflf078w7555";
}
View default.nix
with import <nixpkgs> {};
clangStdenv.mkDerivation {
name = "emojicode-0.6";
src = fetchFromGitHub {
owner = "emojicode";
repo = "emojicode";
sha256 = "0v5r481xhjc3kdk9a49yi9lqnd6gxq5iws4d65dcx43mw3wz38sj";
rev = "5d655df6b7f7ffa13c4addfc140ef83d695381ca";
};
You can’t perform that action at this time.