Skip to content

Instantly share code, notes, and snippets.

@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 = (>>=)
@folone
folone / gist:6089236
Last active January 4, 2025 10:32
Table of unicode operators in scalaz 6.0.x
@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
@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\""
@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;
@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>
@nickbudi
nickbudi / README.md
Last active November 4, 2023 10:53
Cygwin git compatibility with VS Code (or other Windows programs) using cygpath

Cygwin Git + VS Code compatibility

Thanks and credit to mattn and ferreus on GitHub.

Also check out Developing on WSL and/or wslpath (Windows 10 Build 17046 or later) if you're using the Windows Subsystem for Linux.

@seanjensengrey
seanjensengrey / octal_x86.txt
Last active July 9, 2025 04:26
x86 is an octal machine
# source:http://geocities.com/SiliconValley/heights/7052/opcode.txt
From: [email protected] (Mark Hopkins)
Newsgroups: alt.lang.asm
Subject: A Summary of the 80486 Opcodes and Instructions
(1) The 80x86 is an Octal Machine
This is a follow-up and revision of an article posted in alt.lang.asm on
7-5-92 concerning the 80x86 instruction encoding.
The only proper way to understand 80x86 coding is to realize that ALL 80x86
@kumbasar
kumbasar / imagetest.sh
Created April 25, 2019 19:29
How To Create a NTFS Image File in Linux
#!/bin/bash
set -x
image="test.img"
label="test"
mntdir=`mktemp -d`
sudo dd status=progress if=/dev/zero of=$image bs=6M count=1000 && sync
echo 'type=7' | sudo sfdisk $image
@dim13
dim13 / try.c
Created August 9, 2019 12:28
try/catch in plain c
#include <err.h>
#include <stdio.h>
#include <setjmp.h>
#include <signal.h>
static sigjmp_buf exception;
#define try if (!sigsetjmp(exception, 1))
#define catch else
#define throw siglongjmp(exception, 1)