Skip to content

Instantly share code, notes, and snippets.

@ghasshee
ghasshee / autotools.nix
Last active January 3, 2021 10:18
nix pills chat 12
pkgs: attrs:
with pkgs;
let defaultAttrs = {
builder = "${bash}/bin/bash";
args = [ ./builder.sh ];
setup = ./setup.sh;
baseInputs = [ findutils patchelf gnutar gzip gnumake gcc binutils-unwrapped coreutils gawk gnused gnugrep ];
buildInputs = [];
system = builtins.currentSystem;
};
@ghasshee
ghasshee / index.html
Created March 10, 2020 05:06 — forked from tiffany352/index.html
Twitter archive browser
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Twitter Archive Browser</title>
<script src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/babel-standalone@6.15.0/babel.min.js"></script>
<style>
sage
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 8.6, Release Date: 2019-01-15 │
│ Using Python 2.7.16. Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
sage:
sage: notebook()
('The notebook files are stored in:', 'sage_notebook.sagenb')
┌────────────────────────────────────────────────┐
│ │
@ghasshee
ghasshee / error
Created June 1, 2019 13:53
Euterpea compilation failed
[8 of 8] Compiling Main ( Test.hs, dist/build/heap-tests/heap-tests-tmp/Main.o )
Test.hs:15:10: error:
• The constructor ‘Success’ should have 6 arguments, but has been given 3
• In the pattern: Success _ _ _
In a case alternative:
(Success _ _ _)
-> do putStrLn "Tests for Data.Heap.Internal:" >> Internal.runTests
>> putStrLn ""
putStrLn "Tests for Data.Heap.Item:" >> Item.runTests
@ghasshee
ghasshee / confiuration.nix
Created June 1, 2019 13:49
configuration.nix
# HELP => $ man configuration.nix
# SEARCH PKGs => $ nix-env -qaP | grep wget
{ config, pkgs, ... }:
{
imports =
[ ./hardware-configuration.nix ];
hardware = {
-- Type Definition of Matrix
data Mat = Mat [[Int]]
-- Show Instance of Matrix
showRow [] = ""
showRow (x:xs) = show x ++ "\t\b" ++ showRow xs
showMat :: Mat -> String
showMat (Mat []) = ""
showMat (Mat (x:xs)) = showRow x ++ "\n" ++ showMat (Mat xs)
instance Show Mat where show m = showMat m
@ghasshee
ghasshee / zeta.c
Last active September 12, 2015 07:31 — forked from daedalus/zeta.c
Riemann Zeta Function
#include <stdio.h>
#include <math.h>
double lim(double (*f)(double), double p)
{
double a(int n)
{
if (isinf(p)) {
return pow(2, n);
}