Skip to content

Instantly share code, notes, and snippets.

View hazkaz's full-sized avatar
👺
Hacking away at my workstation

Harikrishnan V hazkaz

👺
Hacking away at my workstation
View GitHub Profile
@hazkaz
hazkaz / aoc19_day_one.lisp
Created December 3, 2018 18:53
aoc19 day one part two - solution in 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 June 29, 2018 10:21
Bash Script to download egghead pro videos using their rss feed
#! /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 January 18, 2018 17:23
zigzag PID bot
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 December 27, 2017 17:03
bytearena bot
// 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 February 18, 2015 13:17
Entering the World of Github
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...