Skip to content

Instantly share code, notes, and snippets.

@Dinnerbone
Dinnerbone / minecraft_commands.txt
Last active August 29, 2024 17:22
Minecraft Java Edition 1.13 changes
advancement grant <targets> everything
advancement grant <targets> from <advancement>
advancement grant <targets> only <advancement>
advancement grant <targets> only <advancement> <criterion>
advancement grant <targets> through <advancement>
advancement grant <targets> until <advancement>
advancement revoke <targets> everything
advancement revoke <targets> from <advancement>
advancement revoke <targets> only <advancement>
advancement revoke <targets> only <advancement> <criterion>
@vmxdev
vmxdev / instr_trace.c
Created June 25, 2017 12:23
Trace function calls using -finstrument-functions
#define _GNU_SOURCE
#include <stdio.h>
#include <limits.h>
#include <string.h>
#include <errno.h>
/* ========================================================================= */
static int indent_level = 0;
@ftk
ftk / win2lin.cpp
Last active February 3, 2019 14:52
Wrapper for windows subsystem for linux: run ubuntu applications from windows
// Wrapper for windows subsystem for linux (Bash on Ubuntu on Windows)
// It allows running native ubuntu applications from Windows
// 1. Compile (on windows, the command below is for mingw-gcc):
// g++ -O3 -flto -fwhole-program -fvisibility=hidden -fno-exceptions -fno-rtti -s win2lin.cpp -o win2lin.exe
// 2. make a copy for each program
// for i in git python perl; do cp win2lin.exe ${i}.exe; done
// 3. put directory with exes in windows PATH
// 4. example (from cmd.exe):
// cat "c:\test 1.txt"
// will be translated to: bash -c "exec cat \"/mnt/c/test 1.txt\""
@tgirardi
tgirardi / os-x-update-tzdata.sh
Last active February 7, 2025 18:46
Update tzdata and ICU data on OS X to fix problems with outdated DST information (needs reboot)
#!/bin/bash
# author: Tomás Girardi
# Based on http://helw.net/2011/04/28/updating-osx-for-egypts-dst-changes/ by Ahmed El-Helw
# CHANGE THIS:
# go to https://www.iana.org/time-zones and get the URL for the last DATA
# release
URLTZDATASRC=https://www.iana.org/time-zones/repository/releases/tzdata2016d.tar.gz
# BACKUP your current icu file first
@folone
folone / gist:6089236
Last active January 4, 2025 10:32
Table of unicode operators in scalaz 6.0.x
@23Skidoo
23Skidoo / Applicative.hs
Created August 16, 2012 20:42
Fun with Applicative, Monad and Monoidal
-- See http://blog.ezyang.com/2012/08/applicative-functors/
module Main
where
import Prelude hiding ((**))
import Control.Monad
bind :: Monad m => m a -> (a -> m b) -> m b
bind = (>>=)