Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am shivammistry on github.
  • I am speedismeh (https://keybase.io/speedismeh) on keybase.
  • I have a public key ASDAGiAWG4eWyZ8RwWGnVnB4Fqq4hd75TdfaJ4EqhSHn7Qo

To claim this, I am signing this object:

@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;
@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 / 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 / .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 / 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 / .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 / 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 / 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 / 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"