Skip to content

Instantly share code, notes, and snippets.

Avatar
👺
Hacking away at my workstation

Harikrishnan V hazkaz

👺
Hacking away at my workstation
View GitHub Profile
@hazkaz
hazkaz / aoc19_day_one.lisp
Created Dec 3, 2018
aoc19 day one part two - solution in lisp
View aoc19_day_one.lisp
;; function to check if a given value exists in a list
(defun in (val list)
(if (eq (car list) val) T (if (eq (cdr list) NIL) NIL (in val (cdr list)))))
;; loop through the list in a wraparound fashion until a frequency repeats itself
(let (
(total 0)
(data (mapcar #'parse-integer (uiop:read-file-lines "1.input")))
(n 0)
(existing NIL)
@hazkaz
hazkaz / egghead.sh
Created Jun 29, 2018
Bash Script to download egghead pro videos using their rss feed
View egghead.sh
#! /bin/bash
#usage ./egghead.sh 'rss-url-in-single-quotes' (I don't know why the single quotes are needed, but it doesn't work without)
#requirements - youtube-dl should be installed and available in your path
#curl is also needed
#results - a folder with the coursename will be created where the script is executed with the videos numbered sequentially
#let me know if you have suggestions for improvement
coursename=$(echo $1|egrep -oe 'courses/([^/]*)' | cut -d"/" -f2)
curl "$1" -H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8' > $coursename.rss || echo "acquired rss summary"
@hazkaz
hazkaz / zigzag.js
Created Jan 18, 2018
zigzag PID bot
View zigzag.js
const { vector, comm } = require("bytearena-sdk");
const Vector2 = vector.Vector2;
const agent = comm.connect();
let count = 1
const countLimit = 55
let countDirection = 1
let first = true
let angle = 0
agent.on("perception", perception => {
@hazkaz
hazkaz / wallhit.js
Created Dec 27, 2017
bytearena bot
View wallhit.js
// import SDK and vector facilities to ease development
import { vector, comm } from "bytearena-sdk";
const Vector2 = vector.Vector2;
// Connecting our agent
const agent = comm.connect();
// Watching perception stream
agent.on("perception", perception => {
const actions = [];
@hazkaz
hazkaz / readme.txt
Created Feb 18, 2015
Entering the World of Github
View readme.txt
This is my entry into the world of GitHub and I am obviously very excited to start working on projects whatever they may be.Although I haven't ever created a project of my own till date, I do consider myself a programmer coz I know a teensy bit of c,c++ and lisp :) Hoping GitHub helps me make awesome projects...