Skip to content

Instantly share code, notes, and snippets.

/**
* This is a basic interpreter of the language Swap.
* Link: http://esolangs.org/wiki/Swap
* Author: revcompgeek
*/
module swap;
import tango.io.Console;
import tango.io.Stdout;
@jeremytregunna
jeremytregunna / linked-list.ll
Created August 14, 2011 00:18
Linked List in LLVM IR
;; Linked list implementation
;; I compile it like this on Mac OS X:
;
; llvm-as linked-list.ll
; llc linked-list.bc
; as linked-list.s -o linked-list.o
; ld /usr/lib/crt1.o linked-list.o -o linked-list -lSystem -macosx_version_min 10.6
;; Type aliases
%free_func = type void (i8*)*
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 22, 2024 17:28
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@johanmeiring
johanmeiring / gist:3002458
Created June 27, 2012 08:32
"git lg" alias for pretty git log
# From http://garmoncheg.blogspot.com/2012/06/pretty-git-log.html
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"
@earthgecko
earthgecko / bash.generate.random.alphanumeric.string.sh
Last active July 4, 2024 17:31
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1
@toqueteos
toqueteos / sha1.go
Last active April 10, 2023 19:34
Minecraft player auth SHA-1 digest.
// You can test this online at: https://play.golang.org/p/hhayRT1VWgj
package main
import (
"crypto/sha1"
"encoding/hex"
"fmt"
"io"
"strings"
)
@darkf
darkf / bf.ml
Created May 30, 2013 11:29
Brainfuck interpreter in OCaml
let eval str =
let cells = Array.make 4096 0 in
let ptr = ref 0 in
let len = String.length str in
let rec evalbf c =
if c >= len then
c
else
match String.get str c with
@aadnk
aadnk / NbtFactory.java
Last active December 29, 2020 04:29
A compact library for editing or creating NBT tags, ready to be inserted into your project. It doesn't directly depend on CraftBukkit, but uses reflection to access it dynamically. Use this version for 1.7.2: http://tinyurl.com/attributestorage
package com.comphenix.example;
import java.io.BufferedInputStream;
import java.io.DataInput;
import java.io.DataInputStream;
import java.io.DataOutput;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@ritesh-fueled
ritesh-fueled / installDependenciesToCompileObjectiveCInUbuntu
Last active December 27, 2017 13:36
~ You can use this script to install all the libraries <dependencies> required to compile and run objective-C code in ubuntu + it provides ''compileAndRunObjC" into your terminal which you can use it to compile and run any objective-C code. ~
#!/bin/bash
echo -e "\n\n----------------------starting to install gcc compiler for objective C----------------------";
echo -e "\n----------------------running: <sudo apt-get install gnustep gnustep-devel>----------------------"
sudo apt-get install gnustep gnustep-devel
echo -e "\n----------------------gnustep installed----------------------"
echo -e "\n----------------------running: <sudo apt-get install gobjc>----------------------"
sudo apt-get install gobjc
echo -e "\n----------------------gobjc installed----------------------"
sudo apt-get install tree
echo -e "\n------------------------Making Project structure-------------"
package de.zh32.slp;
import com.google.gson.Gson;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;