Skip to content

Instantly share code, notes, and snippets.

View Lokno's full-sized avatar

Lokno Lokno

View GitHub Profile
@Lokno
Lokno / CCCVector.h
Created April 22, 2018 01:01
C++ wrapper for CCVector.h (a single header matrix and vector library. See: https://gist.github.com/Lokno/dc41ea336edb91490815a85f864b4ce7)
// CCCVector : C++ wrapper classes for CCVector functions
#pragma once
extern "C"
{
#include "CCVector.h"
}
struct CCCVector4
@Lokno
Lokno / CCVector.h
Last active April 30, 2018 03:52
Single c header linear algebra library
#pragma once
#include <math.h>
#include <string.h>
#include <stdlib.h>
#define EPSILON 1e-4f
#ifndef TWOPI
#define TWOPI 6.2831853f
@Lokno
Lokno / erase_cache.bat
Last active April 11, 2018 18:51
Clear the content of the Windows Update cache. Source: https://ccm.net/faq/2471-how-to-purge-the-windows-update-cache
@echo off
net stop wuauserv
CD %Windir%
CD SoftwareDistribution
DEL /F /S /Q Download
net start wuauserv
@Lokno
Lokno / transision.css
Created January 11, 2018 02:29
Added a transition property to lines 31-49 in sylvania.html
html.letter {
background-color: #D3FF99;
color: #005046;
}
html.transition {
transition: background-color 2.0s ease;
background-color: #005046;
color: #ffffff;
}
@Lokno
Lokno / hanoi-domain.pddl
Created November 2, 2017 21:48
Tower of Hanoi Domain for the Metric-FF Planner
(define (domain hanoi-domain)
(:types disk peg - object)
(:predicates (smaller ?x - disk ?y - object )
(on ?x - disk ?y - object)
(clear ?x - object ))
(:functions (cost))
(:action Move
:parameters (?d - disk ?c - object ?n - object)
:precondition (and
(smaller ?d ?n)
@Lokno
Lokno / notweet.ahk
Last active November 2, 2020 19:35
Immediately closes any window containing "Twitter" in the title (autohotkey.com)
SetTitleMatchMode,2
Loop {
IfWinActive, Twitter
{
SendInput ^w
}
Sleep, 1000
}
@Lokno
Lokno / post_as_bot.py
Created September 7, 2017 16:55
Command-line utility for posting a message as a slack bot
import os,sys
from slackclient import SlackClient
if len(sys.argv) < 2:
print "usage: post_as_bot.py <message>"
sys.exit(-1)
msg = ' '.join(sys.argv[1:])
BOT_NAME = 'BOTNAME'
@Lokno
Lokno / notweet.ahk
Created January 19, 2017 21:51
Polls every second and if it finds a window title starting with "Twitter" it closes it
Loop {
IfWinActive, Twitter
{
SendInput ^w
}
Sleep, 1000
}
@Lokno
Lokno / ctrlclick.ahk
Created January 19, 2017 19:40
Uses autohotkey to simulate Mac OS Style ctrl + click for right click functionality in Windows (https://autohotkey.com/)
^LButton::
Send {RButton}
@Lokno
Lokno / strings.cpp
Last active August 28, 2022 10:08
Some methods of printing multiline strings in C++
#include <iostream>
#include <string>
using namespace std;
int main()
{
// you could cascade operators
cout << "+---------+" << endl
<< "| |" << endl