Skip to content

Instantly share code, notes, and snippets.

@daemongh
daemongh / cup.py
Created June 26, 2018 01:31
World Cup Slack Bot
import requests
import os
import pathlib
import json
import pendulum
import hashlib
from time import sleep
UPDATE_INTERVAL = 60
SETTINGS = {
@daemongh
daemongh / unfuk.py
Last active January 27, 2024 15:07
Unpack .fuk files (Railway Empire, Patrician, Port Royale)
import os
import shutil
import sys
import zlib
def read_uint(file):
read_bytes = file.read(4)
result = 0
@daemongh
daemongh / Private-pypi-howto
Created June 21, 2017 17:43 — forked from Jaza/Private-pypi-howto
Guide for how to create a (minimal) private PyPI repo, just using Apache with directory autoindex, and pip with an extra index URL.
*

Keybase proof

I hereby claim:

  • I am daemongh on github.
  • I am daemon (https://keybase.io/daemon) on keybase.
  • I have a public key whose fingerprint is 987B DD04 267E A3CD 32BE D873 185B 6089 9845 DF8B

To claim this, I am signing this object:

setBadge = function (text) {
if (process.platform === "darwin") {
app.dock.setBadge("" + text);
} else if (process.platform === "win32") {
var win = remote.getCurrentWindow();
if (text === "") {
win.setOverlayIcon(null, "");
return;
}
@daemongh
daemongh / ocp.php
Created November 27, 2013 20:05 — forked from ck-on/ocp.php
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok)
Version: 0.1.6
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter
0.1.5 2013-04-12 added graphs to visualize cache state, please report any browser/style bugs
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>App Redirection</title>
</head>
<body>
<!-- iframe used for attempting to load a custom protocol -->
<iframe style="display:none" height="0" width="0" id="loader"></iframe>
def map2png
png = ChunkyPNG::Image.new(15, 15, ChunkyPNG::Color::TRANSPARENT)
$map.each_with_index do |v, y|
v.each_with_index do |_, x|
character = $map[x][y]
case character
when -1 then png[x, y] = ChunkyPNG::Color('black')
when 0 then png[x, y] = ChunkyPNG::Color('white')
when 1 then png[x, y] = ChunkyPNG::Color('red')
@daemongh
daemongh / awesome-php.md
Created October 31, 2012 22:00 — forked from ziadoz/awesome-php.md
Awesome PHP Libraries
@daemongh
daemongh / hack.sh
Created March 31, 2012 18:46 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#