Skip to content

Instantly share code, notes, and snippets.

Minecraft Tools

Links and information for the Minecraft tools I use. I play Minecraft on a Mac, so I don't have any Windows-specific information to impart.

NOTE: There is often a lag between when a new version of Minecraft comes out and when all the mods I use are updated for it. So, often I do not play the new version right when it comes out. If I do want to play the new version right away (or am forced to because of Realms) I have to disable incompatible mods until they are available. For that purpose, I maintain a "mods-disabled" folder along side the "mods" folder in my Minecraft folder and move things in and out of there.

NOTE: The search function on CurseForge does not work for me. I always use a search engine for "CurseForge" and the name of the mod.

Here's a list of the client mods I use:

@gnp
gnp / custom_bytes_iter.rs
Last active March 25, 2021 23:59
Custom bytes iterator
fn compute_bytes_iter<I>(bytes_iter: I) -> Option<u16>
where
I: IntoIterator<Item=u8>
{
for c in bytes_iter.into_iter() {
print!("{}", c as char);
}
println!();
import scala.io.Source
object FastaTestMain {
val header = """^>\s*(.*?)\s*$""".r // Allows destructuring pattern match in parse()
case class FastaItem(header: String, sequence: String)
def readFile(filename: String): Iterator[FastaItem] = {
val conditioned = Source.fromFile("fasta.txt").getLines.map(_.trim).filter(_ != "") // Trim and skip blank lines
@gnp
gnp / gist:2378368
Created April 13, 2012 17:02
Hex and Char dumps
# These arguments work well for me:
od -A d -t x1c -v [file ...]
# -A d => Decimal address base
# -t x1c => One byte at a time, hex and character output
# -v => Do not replace duplicate lines with '*'
@gnp
gnp / grid-mul
Created December 28, 2011 23:46
A Perl 1-liner for a 10x10 multiplication grid for my kids
perl -e 'printf "%2s | ", "X"; for my $i (1..10) { printf "%3d ", $i; }; printf "\n---+-"; for my $i (1..10) { print "----"; } print "\n"; for my $i (1..10) { printf "%2d | ", $i; for my $j (1..10) { printf "%3d ", $i * $j; }; print "\n" }'
@gnp
gnp / grid-add
Created December 28, 2011 23:18
A Perl 1-liner for a 10x10 addition grid for my kids
perl -e 'printf "%2s | ", "+"; for my $i (1..10) { printf "%3d ", $i; }; printf "\n---+-"; for my $i (1..10) { print "----"; } print "\n"; for my $i (1..10) { printf "%2d | ", $i; for my $j (1..10) { printf "%3d ", $i + $j; }; print "\n" }'
@gnp
gnp / grid-100
Created December 28, 2011 23:15
A Perl 1-liner for a 10x10 grid of the numbers 1..100 for my kids
perl -e 'for my $i (0..9) { for my $j (0..9) { printf "%3d ", $i * 10 + $j + 1 }; print "\n" }'
@gnp
gnp / archiveme
Created December 13, 2011 18:41
Generate source tarball of Maven + Git project
#!/bin/bash
echo "Determining Git branch..."
BRANCH=`git branch | grep '^[*] ' | sed -e 's/^[*] //'`
echo "Determining Maven project artifactId..."
ARTIFACT=`mvn help:evaluate -Dexpression=project.artifactId | grep -v '^\[INFO\]'`
echo "Determining Maven project version..."
VERSION=`mvn help:evaluate -Dexpression=project.version | grep -v '^\[INFO\]'`
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.
Find the sum of all the primes below two million.
----------
In Mathematica:
In[1]:= s = 0; p = 2; While[p < 2000000, s += p; p = NextPrime[p]]; s