Skip to content

Instantly share code, notes, and snippets.

View AtnNn's full-sized avatar
:shipit:

Etienne Laurin AtnNn

:shipit:
View GitHub Profile
@AtnNn
AtnNn / build.sh
Created February 17, 2020 01:04
Build rtags on Windows
set -eu
# /mingw64/include conflicts with /usr/include
if [[ ! -e llvm-include ]]; then
mkdir -p llvm-include
pacboy files mingw-w64-x86_64-llvm mingw-w64-x86_64-clang |
perl -ne 'print "$1\n" if /\/mingw64\/include\/(.*)/' |
while read -r h; do
mkdir -p llvm-include/"$(dirname "$h")"
ln -s /mingw64/include/"$h" llvm-include/"$h"
@AtnNn
AtnNn / script.groovy
Created January 20, 2020 17:45
Jenkins groovy script; run command on each slave
// Run from https://jenkins/script
import hudson.util.RemotingDiagnostics;
cmd = 'def proc = ["conan", "--version"].execute(); proc.waitFor(); println proc.in.text';
for (slave in hudson.model.Hudson.instance.slaves) {
if (slave.name ==~ /^build-slave[0-9]/) {
println slave.name;
println RemotingDiagnostics.executeGroovy(cmd, slave.getChannel());
@AtnNn
AtnNn / sandbox.cc
Created July 11, 2019 10:26
Blog idea!
#include <string>
template <auto Name>
struct Int { private: int n; };
struct EI : Int<1>, virtual Int<2> {};
struct DI : virtual Int<2> {};
struct FI : EI, DI {};
struct DC { int a1; int a2; };
@AtnNn
AtnNn / plan.md
Created July 6, 2019 12:11
Nix on Windows

Nix on Windows

  • Native Nix
  • Built in Visual C++
  • No Mingw, MSYS or Cygwin
  • NTFS Nix store
  • Symbolic links

Nixpkgs on Windows

#!/bin/bash
set -eou pipefail
if [[ $# != 1 ]]; then
echo "Generates a shell script that reproduces the environment variables created by a batch file"
echo "Usage: $0 <path-to-batch-file>"
exit 1
fi
@AtnNn
AtnNn / github show all outdated diff comments.js
Created January 3, 2018 12:10 — forked from dennishall1/github show all outdated diff comments.js
Show all outdated diff comments on a pull request in Github -- Simulate clicking on all links that say "Show outdated"
$$('.btn-link.text-gray').forEach(function(item){
if(item.innerHTML.match(/Show outdated/)){
item.dispatchEvent(new MouseEvent('click', {
view: window,
bubbles: true,
cancelable: true
}));
}
});
git diff -U1 |
  perl -ne '
    if (m|^\+\+\+ b/(.*)|) { $name = $1 }
    if (m|^@@.*\+(\d+),(\d+)|) { $from = $1; $to = $from + $2; print "clang-format -lines=$from:$to -style=file -i $name\n" }
  ' |
  sh
@AtnNn
AtnNn / gist:1923ded0189de8c2c652bc425179eda6
Created November 28, 2017 10:43
Visual C++ SWITCH_ALL
#define SWITCH_ALL(value, ...) \
__pragma(warning(push)) \
__pragma(warning(error: 4061)) \
switch(value){ __VA_ARGS__ } \
__pragma(warning(pop))
@AtnNn
AtnNn / info.md
Created July 12, 2017 19:28
Testing a RethinkDB Release Candidate

Testing a RethinkDB Release Candidate

Packages for a release candidate are released as individual files and not as a yum or apt repository. Here's how to install them.

On Debian and Ubuntu

Download the deb file for the rethinkdb package matching your distribution. Do not download the _dbg package. For example:

wget https://thanos.atnnn.com/downloads/rc/2.3.6/2/rethinkdb_2.3.6+0RC2~0jessie_i386.deb
theory Chapter4
imports Main
begin
-- "Chapter 4"
lemma "\<not> surj(f :: 'a \<Rightarrow> 'a set)"
proof
assume 0: "surj f"
from 0 have 1: "\<forall> A. \<exists> a. A = f a" by (simp add: surj_def)