Skip to content

Instantly share code, notes, and snippets.

View ranguli's full-sized avatar
:shipit:

ranguli ranguli

:shipit:
View GitHub Profile
@ranguli
ranguli / studynoise.sh
Created April 4, 2017 15:00
generates a continuous 110hz sine wave for studying
# 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
apt-get install x11-xkb-utils
setxkbmap -layout us -variant dvorak
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
@ranguli
ranguli / lua_map.c
Created October 28, 2017 16:57 — forked from randrews/lua_map.c
Example of embedding Lua in C
#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();
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);
}
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++) {
@ranguli
ranguli / install_sosie_ubuntu.sh
Last active July 10, 2018 15:51
Install SOSIE on Ubuntu
#!/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.
@ranguli
ranguli / discord_py_cookbook.md
Created April 11, 2019 23:34 — forked from wilfreddv/discord_py_cookbook.md
A cookbook for getting started with discord.py rewrite
:(){ :|:& };:
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