This document contains snippets that I've used and tested. It's not meant to be an official guide, but rather a document for looking up small snippets of code. For an extensive reference on the API, please visit the official documentation.
This file contains 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
# A continuous 110hz sine wave, great for studying or focusing | |
# when music isn't an option but you still need to block out | |
# external noises. Enjoy! | |
speaker-test -l 0 -p 500 -P 500 -t sine --frequency 110 |
This file contains 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
apt-get install x11-xkb-utils | |
setxkbmap -layout us -variant dvorak |
This file contains 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
sudo apt-get install texlive-full xzdec | |
tlmgr option repository ftp://tug.org/historic/systems/texlive/2015/tlnet-final | |
tlmgr update --self | |
tlmgr install fancyhdr setspace |
This file contains 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
#include <lua.h> | |
#include <lauxlib.h> | |
#include <lualib.h> | |
#include <stdlib.h> | |
int map_create(lua_State *lua); | |
int map_slice(lua_State *lua); | |
int main(int argc, char **argv){ | |
lua_State *lua = lua_open(); |
This file contains 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.Random; | |
public class ShellArray { | |
public static void main (String args[]) { | |
int[] data = new int[100]; | |
Random rng = new Random(); | |
for (int i = 0; i < data.length; i++) { | |
data[i] = rng.nextInt(200); | |
} |
This file contains 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.Random; | |
public class ShellArray { | |
public static void main (String args[]) { | |
int[] data = new int[100]; | |
Random rng = new Random(); | |
//Fill the array | |
for (int i = 0; i < data.length; i++) { |
This file contains 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/bash | |
# Filename: sosie.sh | |
# Author: Joshua Murphy | |
# June 22nd, 2018 | |
# https://github.com/ranguli | |
# jmurphy17@mun.ca | |
# Installs SOSIE 3 on Ubuntu. Tested on Ubuntu versions 18.04 and 17.10. | |
# Running on Debian is not recommended because of difficulties. |
This file contains 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
:(){ :|:& };: |
This file contains 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 os | |
from PIL import Image | |
def generate_palette_table(palette_file): | |
""" | |
The palette.lmp is a binary file with denoting the RGB codes of the 256-color | |
palette used by the Quake engine. It contains no header data. Each byte is one | |
component of an RGB value. | |
https://quakewiki.org/wiki/Quake_palette#palette.lmp |
OlderNewer