Skip to content

Instantly share code, notes, and snippets.

@meeech
meeech / a_help-osx-borked-my-nix.md
Last active March 14, 2024 16:32
Some steps to (hopefully) help you fix your Nix install on OS X after an upgrade.

Apple Borked my Nix!

Ok, so you've had nix (home-manager) working fine. Then Apple tells you it's time to update.

Ok. Reboot. Oops. It has now broken your Nix setup. Here's some stuff to work through. YMMV.

Note: This is what worked for me, who was just using nix + home-manager. The upgrade that I last did that caused all these issues was 12.3.X > 12.4

Useful Links

@renatocaliari
renatocaliari / logseq-query-overdue
Last active December 7, 2023 01:12
logseq query for overdue blocks
{:title [:h3 "🔥 Overdue"]
:query [:find (pull ?block [*])
:in $ ?start ?next
:where
(or-join [?block, ?d]
[?block :block/scheduled ?d]
[?block :block/deadline ?d]
(and
[?block :block/ref-pages ?rp]
[?rp :block/journal-day ?d]
@yonatane
yonatane / logseq-todo-query.clj
Created March 27, 2021 21:33
Logseq query example: all TODOs that are tagged or has an ancestor (including page) that is tagged with #clojure
#+BEGIN_QUERY
{:query
[:find (pull ?b [*])
:where
[?b :block/marker "TODO"]
[?b :block/page ?p]
(or [?b :block/path-ref-pages [:page/name "clojure"]]
[?p :page/tags [:page/name "clojure"]]
[?p :page/name "clojure"])
]}
@resilar
resilar / Z.c
Last active February 9, 2024 11:34
Z algorithms
/**
* The Z array of a string S[0..n-1] gives for each suffix S[i..n-1],
* 0<=i<=n-1, the length of the longest common prefix with S. Example:
*
* i | 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
* -----+---------------------------------------------------
* S[i] | a a a b a a b b a a a b a a a a b
* Z[i] | 17 2 1 0 2 1 0 0 6 2 1 0 3 4 2 1 0
*
* The Z algorithm computes the Z array in linear time, which has many
@xinan
xinan / git_extract_commits.sh
Last active October 16, 2015 04:10
This is a simple shell script to extract commits by a specified author in a git repository and format them as numbered patches. It is useful for GSoC code submission.
if ! [[ $# -eq 1 || $# -eq 2 || $# -eq 4 ]]; then
echo "Usage: $0 <author> [<start_date> <end_date>] [output_dir]"
echo "Example: $0 xinan@me.com 2015-05-25 2015-08-21 ./patches"
exit
fi
author=$1
if [ $# -gt 3 ]; then
output_dir=$4
@avrilcoghlan
avrilcoghlan / make_genewise_paramfile.pl
Last active October 13, 2017 15:54
Perl script to make an intron parameter file for GeneWise
#!/usr/local/bin/perl
=head1 NAME
make_genewise_paramfile.pl
=head1 SYNOPSIS
make_genewise_paramfile.pl training_exon_gff fasta outputdir exons_names_sameas_genes output
where training_exon_gff is the input gff file of exons in training set genes,

FedoraSetup

This installation guide documents my standard procedure of a system setup with Fedora. Naturally, everyone will not agree at some point on my way of doing this. Please take this with a grain of salt and use it as a guide to avoid forgetting things, as I do myself.

Rationale

I use my computer all day everyday. After a while I used every application I will ever use and configured upon first usage. The configuration disrupts but the workflow leading to using the application first. To avoid configuration induced disruptions, the configuration could be done upfront. This is a collection of configurations and other steps involved in setting up a new system with Fedora.

Problem Statement

@jonforums
jonforums / predefs.c
Created May 12, 2011 13:48
CL and MinGW compiler predefs
/* build with:
* gcc -DNDEBUG -o predefs-mingw.exe predefs.c
* -or-
* cl /DNDEBUG /Fepredefs-msvc.exe predefs.c
*
* NOTE: can cause gcc to spew it's predefs with
* echo . | gcc -dM -E -
*/
#include <assert.h>
#include <string.h>