Skip to content

Instantly share code, notes, and snippets.

!/bin/bash
set -euo pipefail
if [ -d dosbox ]; then
echo "update"
cd dosbox
git svn fetch
else
echo "clone"
@egore
egore / .zshrc
Last active February 2, 2021 07:57
zshrc similar to my bash preferences
HISTFILE=~/.bash_history
HISTSIZE=1000000
SAVEHIST=1000000
zstyle :compinstall filename '~/.zshrc'
autoload -Uz compinit promptinit
compinit
promptinit
prompt gentoo
bindkey "^[[5~" history-beginning-search-backward
bindkey "^[[6~" history-beginning-search-forward
--- cegui-0-8-7/cegui/src/XMLParserModules/TinyXML/XMLParser.cpp.orig 2016-04-28 21:53:04.000000000 +0200
+++ cegui-0-8-7/cegui/src/XMLParserModules/TinyXML/XMLParser.cpp 2020-09-27 01:14:23.246753692 +0200
@@ -130,7 +130,7 @@
processElement(childNode->ToElement());
break;
case TiXmlNode::CEGUI_TINYXML_TEXT:
- if (childNode->ToText()->Value() != '\0')
+ if (childNode->ToText()->Value() != nullptr)
d_handler->text((encoded_char*)childNode->ToText()->Value());
break;
@egore
egore / RemoveConfluenceAttachments.java
Created June 2, 2020 16:32
Swing UI to delete attachments from confluence pages in batches
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.itextpdf.xmp.impl.Base64;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import javax.net.ssl.HttpsURLConnection;
import javax.swing.*;
import javax.xml.ws.Holder;
import java.awt.*;
<?php
declare (strict_types = 1);
/**
* Create SQL scripts to add images to the Wordpress media library. Note that this does not create thumbnails (etc.)
* Run using 'php rebuild.php' in a copy of your wordpress folder
*/
const BASE_URI = 'http://YOUR_IP_OR_HOSTNAME_GOES_HERE/';
function clearname(string $name) {
@egore
egore / rumble.cpp
Last active December 30, 2020 11:58
SDL 2 based rumble tester I use for PS3 controllers
#include <SDL2/SDL.h>
#include <cstdio>
#include <list>
#include <signal.h>
std::list<std::pair<SDL_Joystick*, SDL_Haptic*>> joysticks;
void shutdown_joysticks() {
SDL_Log("Closing joysticks");
for (std::pair<SDL_Joystick*, SDL_Haptic*> joystick : joysticks) {
@egore
egore / picasa-opencv.py
Created February 2, 2019 23:47
Read picasa.ini and show the faces detected by picasa using python and opencv
import configparser
import cv2
import sys
def coordinates(rect):
'''
Translate encoded coordinates from picasa.ini into number array
'''
# From 'rect64(x)' to 'x'
rect = rect[7:]
--- /usr/lib/pcsc/drivers/SCLGENERIC.bundle/Contents/Info.plist 2011-01-17 12:02:25.000000000 +0100
+++ /usr/lib/pcsc/drivers/SCLGENERIC.bundle/Contents/Info.plist 2019-01-09 20:35:49.299937762 +0100
@@ -34,6 +34,7 @@
<string>0x04E6</string>
<string>0x04E6</string>
<string>0x04E6</string>
+ <string>0x04E6</string>
</array>
<key>ifdProductID</key>
--- scmccid/PKGBUILD 2018-05-04 13:38:08.000000000 +0200
+++ scmccid/PKGBUILD 2019-01-09 20:25:02.138243091 +0100
@@ -7,24 +7,17 @@
arch=('i686' 'x86_64')
url="http://support.identiv.com/products/"
license=('custom')
-depends=('pcsclite' 'libusb0')
+depends=('pcsclite' 'libusb-compat')
makedepends=('unzip')
backup=('usr/local/scm/ini/scmccid.ini')