Skip to content

Instantly share code, notes, and snippets.

View Lokno's full-sized avatar

Lokno Ketchup Lokno

View GitHub Profile
@Lokno
Lokno / scrub.ahk
Created June 17, 2016 21:18
Remaps keys in photoshop for scrubbing
#IfWinActive, ahk_class Photoshop
{
; sends Page Up instead of comma ( Back one frame )
,::
SendInput {PgUp}
return
; sends Page Down instead of period ( Forward one frame )
.::
@Lokno
Lokno / javai.py
Last active July 19, 2016 21:23
A basic Java interpretor
# Provides a basic command line interpretor for Java
#
# Recognizes import statements and places them accordingly
# All other statements are placed in the body of a main method
# To execute and print a result type "print <statement>"
# Type q/e/quit/exit/close to exit interpretor
import subprocess,re
def writeJava( filename, classname, imports, state, cmdstr ):
@Lokno
Lokno / stitch.py
Last active July 20, 2016 21:21
Script to update a ratio via commands posted in a twitch channel
# Script to update a ratio via commands posted in a twitch channel
# See: http://help.twitch.tv/customer/portal/articles/1302780-twitch-irc
import socket
import re,os
server = "irc.chat.twitch.tv"
channel = "#CHANNEL"
botnick = "NICKNAME"
password = "OAUTHPASS"
@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
@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 / 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 / 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
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 / 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 / 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;
}