Skip to content

Instantly share code, notes, and snippets.

View tlamadon's full-sized avatar

Thibaut Lamadon tlamadon

View GitHub Profile
@jmatsushita
jmatsushita / README
Last active June 29, 2024 23:55
Setup nix, nix-darwin and home-manager from scratch on an M1 Macbook Pro
###
### [2023-06-19] UPDATE: Just tried to use my instructions again on a fresh install and it failed in a number of places.
###. Not sure if I'll update this gist (though I realise it seems to still have some traffic), but here's a list of
###. things to watch out for:
### - Check out the `nix-darwin` instructions, as they have changed.
### - There's a home manager gotcha https://github.com/nix-community/home-manager/issues/4026
###
# I found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs).
# So here's a minimal Gist which worked for me as an install on a new M1 Pro.
@gnanderson
gnanderson / fif.sh
Last active November 3, 2023 15:30
Find in file using ripgrep, then fuzzy find matched filenames with fzf, preview match using bat
fif() {
rg \
--column \
--line-number \
--no-column \
--no-heading \
--fixed-strings \
--ignore-case \
--hidden \
--follow \
@doi-t
doi-t / getting-start-with-AWS-Batch.md
Last active January 2, 2023 09:50
A log of getting start with AWS Batch.
@jdiamond
jdiamond / Dockerfile
Created November 16, 2017 02:24
SSH certificates
FROM alpine
# Install OpenSSH:
RUN apk -U add openssh
# Generate host keys:
RUN ssh-keygen -A
# Create users:
RUN adduser -D user1
@gdlmx
gdlmx / Sci_workflow_management.md
Last active April 26, 2023 16:55
Scientific workflow management systems
@Onurtag
Onurtag / ExploreEverything.ahk
Last active February 25, 2024 07:23
ExploreEverything.ahk: An autohotkey (ahk v1) script that allows you to search the current explorer folder, your desktop and more using Everything
#SingleInstance Force
#NoTrayIcon ;Comment this line by adding a ; in front of # if you want the tray icon to be visible. Like ;#NoTrayIcon
EverythingPath := "C:\Program Files\Everything\Everything.exe" ;Set this to your everything.exe path. Keep the quotes.
;---Optional setup for special folders---
MyRecycleBin := "Recycle Bin" ;If your OS is not English, go to your explorer's "Recycle Bin" (🚮) folder and change this to the title of that window. Keep the quotes.
MyThisPC := "This PC" ;If your OS is not English, go to your explorer's "This PC" (💻) folder and change this to the title of that window. Keep the quotes.
MyHome := "Home" ;(Windows 11) If your OS is not English, go to your explorer's "Home" (🏠) folder and change this to the title of that window. Keep the quotes.
@pditommaso
pditommaso / feedback.nf
Last active July 28, 2021 09:06
Nextflow script showing how to repeat the execution of a process
#!/bin/env nextflow
Channel
.from('abc')
.map { tuple(0,it) }
.set { foo }
Channel.create().set { feedback }
index = 0
@jennybc
jennybc / 2014-10-12_stop-working-directory-insanity.md
Last active September 23, 2022 04:43
Stop the working directory insanity

There are packages for this now!

2017-08-03: Since I wrote this in 2014, the universe, specifically Kirill Müller (https://github.com/krlmlr), has provided better solutions to this problem. I now recommend that you use one of these two packages:

  • rprojroot: This is the main package with functions to help you express paths in a way that will "just work" when developing interactively in an RStudio Project and when you render your file.
  • here: A lightweight wrapper around rprojroot that anticipates the most likely scenario: you want to write paths relative to the top-level directory, defined as an RStudio project or Git repo. TRY THIS FIRST.

I love these packages so much I wrote an ode to here.

I use these packages now instead of what I describe below. I'll leave this gist up for historical interest. 😆

@mckaydavis
mckaydavis / log_exec.py
Created June 23, 2014 21:50
Python non-blocking reading from stdout and stderr of subprocess.popen process using os.pipe and select.select
#!/usr/bin/env python
# File: log_exec.py
# Author: McKay Davis
# Date: Jun 23, 2014
# Non-blocking stdout and stderr read from a
# Popen process
import os
import subprocess
function laplace_idiomatic (del_x::Array{Float64, 3}, x::Array{Float64, 3})
n1, n2, n3 = size (x)
for i3 = 2:n3-1, i2 = 2:n2-1, i1 = 2:n1-1
del_x[i1,i2,i3] =
x[i1+1,i2,i3] + x[i1-1,i2,i3] +
x[i1,i2+1,i3] + x[i1,i2-1,i3] +
x[i1,i2,i3+1] + x[i1,i2,i3-1] -
6.0 * x[i1,i2,i3]