Skip to content

Instantly share code, notes, and snippets.

@ShivamMistry
ShivamMistry / n00mbers
Created February 15, 2012 21:59
999999^2^20
This file has been truncated, but you can view the full file.
5ffd603cb82b55ec5cedada7552d9a914e8663f8350d6dfc1bd4988aa05f23a6ae006605ee43d8836a9e409c91f5a96ba0263e1be26d6e1473bb24d8b6b1f5543372bf1f4a4e63c38d76278e409e174beb36045ef6a4b751778365438bda95b300554d27c0c133d5430191796e14786517edc06f436d2c38af793920237053f0d528f66464501ec16eea8afcc4a81e208c67074fdd4168332cafa3fd128c6e220fe5f5414eed5cce1e247952d0449979df238fc9396fb0edd650bbd58a479b32bb77fc3439302a168747997e8e9def15cbaa03632b2b7a2ec030f213ead1695baea2ea765a269383ffed7c5616d5458ec536e96aa9dad895da72c4612bdd415ef7c8b486ec70d4347d927d4e113e25954b74807023136ee6b9cdd7470ec0a73c0c90f44c425e45e496dab062059f3821a9911a3680df9743d5044e12043cc8260d19d50ae61f772dbaa9f59ec6a2580ff9931dd7af71577ab70c28c8de3369e4e6df4c14d9d380725f0f94f57cb569729aae00b5c049ff956f5f5d95c01433dcb6a36617379638f5c0fd311b9a77e5dd836713bdae3c674a1eec6fedf7309a4f69379fe926f4fba51289bfea5244b557edf3724efdac6f7e77627ceae7bb9e14c04ac5a145ae1abd7f7b4ba34cbf1c5b11c0bb8bba9e53ca8e986428f463a853c074bcba8a2dfc466ba8d07a1619ec8177fff808e8ffbc56dbb6d28a99eb41a8
@ShivamMistry
ShivamMistry / numbers.rb
Created October 22, 2012 23:39
Calculates 999999^2^20 and stores the value in base 16 to a file
def calc()
x = 999999
20.times{x = x * x}
return x
end
t1 = Time.now
x = calc()
t2 = Time.now
print (t2-t1).to_s + "s taken to calc 999999^2^20\n"
@ShivamMistry
ShivamMistry / nas-wired
Last active September 2, 2018 20:28
Wired NAS netctl config and wpa_supplicant config for University of York
Description='NAS York'
Interface=enp3s0
Connection=ethernet
IP=dhcp
Auth8021X=yes
Priority=2
WPAConfigFile=/etc/wpa_supplicant/nas.conf
@ShivamMistry
ShivamMistry / eduroam-wifi
Last active May 27, 2018 20:33
Wireless eduroam netctl config for University of York
Description='Eduroam York'
Interface=wlp4s0
Connection=wireless
Security=wpa-configsection
IP=dhcp
Priority=1
ESSID=eduroam
WPAConfigSection=(
'ssid="eduroam"'
'key_mgmt=WPA-EAP'
@ShivamMistry
ShivamMistry / .bashrc
Created April 27, 2014 01:36
.bashrc
#
# ~/.bashrc
#
[[ $- != *i* ]] && return
# Aliases
alias ls='ls --color=auto'
alias fucking='sudo'
alias fuckoff='poweroff'
@ShivamMistry
ShivamMistry / lsuspend.sh
Created May 8, 2014 16:12
Suspension utility that locks before suspending using slimlock and pm-suspend (from pm-utils). Run with sudo
#!/usr/bin/env sh
if [ $(id -u) -eq "0" ]; then
su $(who -m | awk '{print $1;}') -c slimlock > /dev/null 2>&1 &
pm-suspend
else
echo "Run with sudo instead"
fi
@ShivamMistry
ShivamMistry / .vimrc
Last active August 29, 2015 14:08
.vimrc
syntax on
set t_co=256 colorcolumn=80
set nu softtabstop=4 expandtab shiftwidth=4
set ignorecase smartcase autoindent incsearch hlsearch
set cursorline formatoptions=c,q,r,t mouse=a background="dark"
filetype plugin indent on
colorscheme molokai
let g:rehash256 = 1
let g:molokai_original = 1
@ShivamMistry
ShivamMistry / problem01.j
Last active August 29, 2015 14:16
Project Euler Problem 01 in Jasmin
.class public Euler01
.super java/lang/Object
.method public static main([Ljava/lang/String;)V
.limit stack 3
.limit locals 3
iconst_0
dup
istore_1
@ShivamMistry
ShivamMistry / problem02.j
Created February 23, 2015 23:20
Project Euler Problem 02 in Jasmin
.class public Euler02
.super java/lang/Object
.method private static fib(I)I
.limit stack 3
.limit locals 1
iconst_0
iload_0
if_icmpne Test1
@ShivamMistry
ShivamMistry / astar.c
Last active April 14, 2016 19:13
A* in C
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#define GRID_X 3
#define GRID_Y 3
typedef struct node {
int x, y;
int g_cost, f_cost;