Skip to content

Instantly share code, notes, and snippets.

View nikoheikkila's full-sized avatar
🇺🇦
Stand with Ukraine

Niko Heikkilä nikoheikkila

🇺🇦
Stand with Ukraine
View GitHub Profile
@nikoheikkila
nikoheikkila / changes.fish
Last active April 5, 2020 05:01
Fish Shell: Generate a clean changelog between two Git revisions
function changes -d "Generate a Markdown changelog from conventional commits" -a target
# Use fallback variables if no arguments were given.
if test (count $argv) -eq 0
set target master
end
# Include commit message, author name, and the short hash in parentheses.
set -l log_format "%s (_%aN_) (%h)"
@pascalpoitras
pascalpoitras / config.md
Last active April 8, 2024 18:58
My WeeChat configuration

WeeChat Screenshot

Mouse


enable


@nikoheikkila
nikoheikkila / build.sh
Last active March 19, 2016 12:42
Bash: Upgrade WeeChat
#!/bin/bash -eu
#
# build.sh
#
# Builds the development version WeeChat with CMake
# Place this script in the build directory of WeeChat
# @author Niko Heikkilä <yo@nikoheikkila.com>
# Paths
ROOTDIR=$HOME/weechat
@nikoheikkila
nikoheikkila / dosbox-0.74.conf
Created August 30, 2013 17:18
DOSBox 0.74 configuration
# This is the configurationfile for DOSBox 0.74. (Please use the latest version of DOSBox)
# Lines starting with a # are commentlines and are ignored by DOSBox.
# They are used to (briefly) document the effect of each option.
[sdl]
# fullscreen: Start dosbox directly in fullscreen. (Press ALT-Enter to go back)
# fulldouble: Use double buffering in fullscreen. It can reduce screen flickering, but it can also result in a slow DOSBox.
# fullresolution: What resolution to use for fullscreen: original or fixed size (e.g. 1024x768).
# Using your monitor's native resolution with aspect=true might give the best results.
# If you end up with small window on a large screen, try an output different from surface.
@nikoheikkila
nikoheikkila / main.py
Created May 25, 2013 09:26
Python: general main() function
"""Module docstring
This is a placeholder for a long usage message.
"""
import sys
import getopt
def process(arg):
@nikoheikkila
nikoheikkila / cdb_example.py
Created April 24, 2012 19:59
Python: CouchDB example
"""
cdb_example.py
CouchDB example script
API documentation: http://packages.python.org/CouchDB/getting-started.html
"""
import sys
import couchdb
@nikoheikkila
nikoheikkila / printr.py
Created March 7, 2012 13:56
Python: Recursive printer for lists
#################################################################
# #
# PRINTR.PY #
# #
# Advanced printing for python terminal or file handling #
# Homepage: http://pypi.python.org/pypi/printr #
# #
#################################################################
import sys
@nikoheikkila
nikoheikkila / index.html
Created March 6, 2012 21:56
HTML5: Basic Template
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<!-- Headers and title text -->
<meta charset="utf-8">
<title>
@nikoheikkila
nikoheikkila / hwmodule.py
Created February 18, 2012 18:04
Python: hwmodule-0.1
import os, sys, hashlib
# -*- coding: utf-8 -*-
def encryptMAC(address):
''' Generate MD5 checksum from unicode physical address '''
try:
# Calculate checksum
print("Calculating, please wait...", end="\n")
checksum = hashlib.md5(address.encode('utf-8'))
@nikoheikkila
nikoheikkila / utils.js
Created September 1, 2011 08:48
Javascript: Utility library
/**
* utils.js
*
* @author Niko Heikkilä (@ytserman) <http://scr.im/ytserman>
*
* Contains several utility functions for cross-browser compatibility.
* Drop this into your javascript folder and call before other scripts.
*
*/
function createRequest() {