Skip to content

Instantly share code, notes, and snippets.

@twerp
twerp / attic.py
Created December 11, 2017 18:14
WIP tool to "analyze" dokuwiki contents (currently prints out folders, pages and page revisions)
import os
import datetime
TOPFOLDER = r'..\wiki\data\attic'
class Folder():
_page_blacklist = ['sidebar']
blacklist = ['tag', 'testi', 'wiki']
@twerp
twerp / es6-component.html
Created January 31, 2018 17:20
Most simple React component using ES6 class & JSX
<div id="root"></div>
<script src="https://unpkg.com/[email protected]/umd/react.development.js"></script>
<script src="https://unpkg.com/[email protected]/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/[email protected]/babel.js"></script>
<script type="text/babel">
class Button extends React.Component {
constructor() {
super(); this.state = { count: 0 }
}
updateCount() {
@twerp
twerp / functions.py
Last active May 24, 2025 18:01
Link-checker / link-reporter for dokuwiki text files (WIP; Python3.6)
import os
import random
import requests
import time
from collections import namedtuple
from datetime import datetime
from pprint import pprint
from urllib.parse import urlparse
@twerp
twerp / restartAudio.bat
Created January 12, 2019 17:54 — forked from tigerhawkvok/restartAudio.bat
Restart Windows Audio Service (with admin permissions, if needed)
rem Written for buggy audio drivers that need to be restarted
rem In my case, the Claro 8.18 drivers bug out every once in a while on Windows 10, and need restarting to not sound poppy
@echo off
goto check_Permissions
:check_Permissions
echo Administrative permissions required to run this script. Checking...
net session >nul 2>&1