This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Prepend a segment to the path (takes priority). | |
prepend_PATH() { | |
export PATH="$1:$PATH" | |
} | |
# Append something to your PATH (current PATH takes priority). | |
append_PATH() { | |
export PATH="$PATH:$1" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Pygments lexer for MLIR. | |
# Authors: Karl F. A. Friebel (@KFAFSP), Clément Fournier (@oowekyala) | |
# Usage: pygmentize -x -l ./MLIRLexer.py:MLIRLexer file.mlir | |
# | |
# MIT License | |
# | |
# Copyright (c) 2024 Clément Fournier, Karl F. A. Friebel | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prepend_PATH() { | |
export PATH="$1:$PATH" | |
} | |
append_PATH() { | |
export PATH="$PATH:$1" | |
} | |
# Delete some part of the path | |
# https://unix.stackexchange.com/questions/108873/removing-a-directory-from-path |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import net.sf.saxon.Configuration; | |
import net.sf.saxon.expr.Expression; | |
import net.sf.saxon.expr.LocalVariableReference; | |
import net.sf.saxon.om.StructuredQName; | |
import net.sf.saxon.sxpath.IndependentContext; | |
import net.sf.saxon.sxpath.XPathEvaluator; | |
import net.sf.saxon.sxpath.XPathExpression; | |
import net.sf.saxon.trans.XPathException; | |
import net.sf.saxon.value.BooleanValue; | |
import net.sf.saxon.value.SequenceType; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- xmlns and stuff --> | |
<language id="java" displayName="Java"> | |
<versions> | |
<version id="13" displayName="Java 13" /> | |
<version id="15" displayName="Java 15" /> | |
</versions> | |
<parser class="...JavaParser"/> | |
<violationSuppressor class="...JavaViolationSuppressor"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
/** | |
* A set of 2 elements. Unfortunately, {@link Set#of(Object, Object)} | |
* does not guarantee stable iteration order across JVM | |
* instances. | |
*/ | |
public final class Set2<T> extends AbstractSet<T> { | |
private final T e0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tlmgr install avantgar bookman charter cmextra courier ec euro euro-ce eurosym fpl helvetic lm-math marvosym mathpazo ncntrsbk palatino pxfonts refs symbol times txfonts utopia wasy wasysym zapfchan zapfding |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
exec scala "$0" "$@" | |
!# | |
/* | |
A compiler from Brainfuck to C, with some peephole optimizations. | |
Usage (no compilation required): | |
./bfc.scala -f <brainfuck source file> -o <output file name> (<gcc flag>)* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.Collection; | |
import java.util.Collections; | |
import java.util.Comparator; | |
import java.util.HashSet; | |
import java.util.Iterator; | |
import java.util.List; | |
import java.util.Optional; | |
import java.util.Set; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class JavaEscapeUtil { | |
/** | |
* Replaces unprintable characters by their escaped (or unicode escaped) | |
* equivalents in the given string | |
*/ | |
public static String escapeJava(String str) { | |
StringBuilder retval = new StringBuilder(); | |
for (int i = 0; i < str.length(); i++) { | |
final char ch = str.charAt(i); |
NewerOlder