Skip to content

Instantly share code, notes, and snippets.

View testman42's full-sized avatar
:octocat:
Converting caffeine into code

testman42

:octocat:
Converting caffeine into code
View GitHub Profile
@B0073D
B0073D / sopel_adapter.py
Last active January 21, 2016 15:55
Early work for Sopel Adapt integration. This could be one possible way for Adapt to be used in a 'simple' manner.
import sopel.module
import sopel.formatting
# Adapt imports:
import json
from adapt.intent import IntentBuilder
from adapt.engine import IntentDeterminationEngine
def adapter(*intent_list):
@Extraltodeus
Extraltodeus / Cutwallpaper - Read me
Last active January 22, 2016 01:02
This script was made for triple monitor users, to automatically cut a picture in 3 equal parts, with good proportions
As far as I know you can put the .desktop file in ~/.local/share/kservices5/ServiceMenus/ if you're on Plasma 5
Don't forget to edit the commented lines if you want it to work as you wish.
The right-click function does not seem to work when there is a space in the path. Yet.
anonymous
anonymous / smsMail
Created January 31, 2014 14:49
function smsMail()
{
try
{
var label = GmailApp.getUserLabelByName('smsMail');
var threads = label.getThreads();
var now = new Date().getTime();
var cal=getCalendar();
for(i in threads)
@Koncord
Koncord / build.sh
Created February 21, 2017 14:34
Build luasql
#################################################
export sqlitever=3150200
export luatarget=linux #linux mingw
export luasqltargets="sqlite3 mysql"
#################################################
git clone https://github.com/keplerproject/luasql
mkdir -p downloads
/*
*
* Eg. SEND_INTERVAL = 3000; CAPTURE_INTERVAL = 50
*
* - Capture mousemove & mousedown event after every 50 ms
* - For each captured mouse event, save it into a local cache object
* - After every 3 seconds, sends the cached mouse event history to server,
* then clear cache. Exceptions are:
* 1. A click event triggers data submission to server (as described above) immediately
* 2. Pause sending data to server when there is no new movement,
@Koncord
Koncord / server.lua
Created July 23, 2016 14:21
Example for TES3MP GUI
function OnPlayerSendMessage(pid, message)
local pname = tes3mp.GetName(pid)
print(pname.."("..pid.."): "..message)
if myMod.OnPlayerMessage(pid, message) == 0 then
return 0
end
if message:sub(1,1) == '/' then
local cmd = (message:sub(2, #message)):split(" ")
@juusechec
juusechec / install.sh
Last active April 27, 2018 18:58
Universal Install Script https://xkcd.com/1654/
#!/bin/bash
pip install "$1" &
easyinstall "$1" &
brew install "$1" &
npm install "$1" &
yum install "$1" & dnf instal "$1" &
docker run "$1" &
pkg install "$1" &
apt-get install "$1" &
@gvx
gvx / mastermind.py
Created May 16, 2011 20:20
An implementation of Knuth's five-guess algorithm to solve a mastermind code [CC0]
from itertools import product
def score(self, other):
first = len([speg for speg, opeg in zip(self, other) if speg == opeg])
return first, sum([min(self.count(j), other.count(j)) for j in 'ABCDEF']) - first
possible = [''.join(p) for p in product('ABCDEF', repeat=4)]
results = [(right, wrong) for right in range(5) for wrong in range(5 - right) if not (right == 3 and wrong == 1)]
def solve(scorefun):
// Unlock all cooldowns
CCooldownHandler.prototype.BAttack = function() {
return true;
}
@tatic0
tatic0 / README
Created September 8, 2012 13:44
progress bar using zenity
zenity example