Skip to content

Instantly share code, notes, and snippets.

View neizod's full-sized avatar
📚
phd completed, seeking my new goal in life

Nattawut Phetmak neizod

📚
phd completed, seeking my new goal in life
View GitHub Profile
@lewcpe
lewcpe / sputnik.py
Created March 3, 2021 11:15
Extract raw data from SputnikV paper
PLACEBO_DATA = "h 12.837 v 1.644 h 2.57 v 0.82 h 2.56 v 0.82 h 2.57 v 2.464 h 2.569 v 1.639 h 7.699 v 0.82 h 2.569 v 1.639 h 2.569 v 1.644 h 2.562 v 1.639 h 2.568 v 0.82 h 2.57 v 0.825 h 2.561 v 4.103 h 2.569 v 1.639 h 2.569 v 1.64 h 2.569 v 1.671 h 2.561 v 2.556 h 2.57 v 3.451 h 2.568 v 2.62 h 5.13 v 3.597 h 2.57 v 2.723 h 2.569 v 0.906 h 2.569 v 1.822 h 2.561 v 3.645 h 2.569 v 0.911 h 2.569 v 2.745 h 2.561 v 1.827 h 2.569 v 2.75 h 2.569 v 3.666 h 5.131 v 0.923 h 2.568 v 0.922 h 2.569 v 0.922 h 2.57 v 1.849 h 5.13 v 2.782 h 2.57 v 1.855 h 2.568 v 0.933 h 2.562 v 1.866 h 2.569 v 0.932 h 7.698 v 0.944 h 2.57 v 2.863 h 2.569 v 2.879 h 7.699 v 1.041 h 2.569 v 1.073 h 7.7 v 1.191 h 2.569 v 2.454 h 7.698 v 1.396 h 2.57 v 1.462 h 2.561 v 3.084 h 2.569 35.935 2.569"
VACCINATED_DATA = "h 2.569 v 0.55 h 2.569 v 0.545 h 5.131 V 1.92 h 2.568 v 1.095 h 2.57 v 0.819 h 2.56 v 1.095 h 2.57 v 1.644 h 2.569 v 0.819 h 2.569 v 0.545 h 2.561 v 1.37 h 2.569 v 0.549 h 2.569 v 1.365 h 2.569 v 0.55 h 2.562 v 1.644 h 2.568 v 0.27 h 2
@marmakoide
marmakoide / LICENSE.md
Last active March 13, 2024 14:29
Compute and display a Laguerre-Voronoi diagram (aka power diagram), only relying on a 3d convex hull routine. The Voronoi cells are guaranted to be consistently oriented.

MIT License

Copyright (c) 2021 Devert Alexandre

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

@drola
drola / set_nemo_filemanager.sh
Created December 9, 2017 06:14
Set Nemo as the default file manager in Ubuntu 17.10
#!/bin/bash
sudo apt-get install --yes nemo
xdg-mime default nemo.desktop inode/directory application/x-gnome-saved-search
gsettings set org.gnome.desktop.background show-desktop-icons false
gsettings set org.nemo.desktop show-desktop-icons true
@jefferymiller
jefferymiller / KeyMap.ini
Created September 13, 2015 21:45
KeyMap.ini for Pirates! to play with tenkeyless keyboards.
; Key mappings for Sid Meier's Pirates!
; Useful for tenkeyless keyboards.
; Install to ~\Documents\My Games\Sid Meier's Pirates!\
;
; Commands for ship battles
[Battle]
Pause_P = P
ChainShot_c = c ;Also Num7
GrapeShot_g = g ;Also Num1
RoundShot_r = r ;Also Num3
@lukechampine
lukechampine / Y Combinator in Haskell.md
Last active May 20, 2024 14:56
Deriving the Y Combinator in Haskell

The Y Combinator

The Y Combinator is a classic lambda calculus construct that many people find baffling. Here's my attempt to explain it as clearly as possible (no promises!). Familiarity with Haskell syntax is assumed.

The problem we're trying to solve is how to write an anonymous function (a "lambda") that is recursive. Normally, if you want to write a recursive function, it looks like this:

fac n = if n == 0 then 1
        else n * fac (n-1)
@hmason
hmason / test.sh
Created August 21, 2012 22:01
Did you know that bash will reload a script *while it is executing*?!
#!/bin/bash
function addnext {
NUM=$1
sleep 1
echo HI $NUM
NUM=$(expr $NUM + 1)
echo addnext $NUM >> $0
}
@masak
masak / explanation.md
Last active May 21, 2024 20:05
How is git commit sha1 formed

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <jnthn@jnthn.net>
Date:   Sun Apr 15 16:35:03 2012 +0200

When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.

@tundal45
tundal45 / unix_books.md
Created February 20, 2012 20:03
This is a list of UNIX books that one should have around to get better at UNIX. The initial list below is started with recommendations from [Avdi Grimm](twitter.com/avdi). The idea is to have more people recommend books that need to be added to the list.
@Python1Liners
Python1Liners / LICENSE.txt
Created February 20, 2012 19:14 — forked from 140bytes/LICENSE.txt
Python 1-Liners -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2012 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@aconrad
aconrad / highlight.js
Created December 27, 2011 06:48
bootstrap syntax highlighting on blogger dynamic views
// Read instructions here: http://www.alexconrad.org/2011/12/highlight-code-with-bloggers-dynamic.html
(function() {
try {
prettyPrint();
} catch(e) {
var scriptId = 'prettyPrinter';
if (document.getElementById(scriptId) === null) {
var elem = document.createElement('SCRIPT');
elem.id = scriptId;
elem.onload = function() {