Skip to content

Instantly share code, notes, and snippets.

View wiktor-k's full-sized avatar
🇺🇦
Support Ukraine!

Wiktor Kwapisiewicz wiktor-k

🇺🇦
Support Ukraine!
View GitHub Profile
@mef
mef / pre-render.js
Last active May 20, 2022 16:56
proof-of-concept pre-rendering d3.js svgs on the server using node.js and jsdom module.
// pre-render d3 charts at server side
var d3 = require('d3')
, jsdom = require('jsdom')
, fs = require('fs')
, htmlStub = '<html><head></head><body><div id="dataviz-container"></div><script src="js/d3.v3.min.js"></script></body></html>'
jsdom.env({
features : { QuerySelector : true }
, html : htmlStub
, done : function(errors, window) {
@grugq
grugq / gist:7713916
Created November 30, 2013 00:43
The text from: http://dee.su/uploads/baal.html On Underground Communications
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Undercover communication
It should be obvious by now, that the only way to communicate
stealthily and securely is to avoid raising suspicion to the
level at which the authorities might consider it worthwhile
to put you under active surveillance (e.g., park a van with
TEMPEST equipment by your apartment).
@massar
massar / server-git.conf
Created March 6, 2014 21:14
Example nginx + git HTTP Smart mode (git-http-backend) + HTTP Authentication + HTTPS redirect
# Example nginx + git HTTP Smart mode (git-http-backend) + HTTP Authentication + HTTPS redirect
# jeroen@massar.ch - http://jeroen.massar.ch
server {
listen 192.0.1.1:80;
listen [2001:db8::1]:80;
# Redirect all non-HTTPS traffic to the HTTPS variant
return 301 https://$host$request_uri;
}
@hjst
hjst / gpg.rc
Last active February 29, 2024 10:02
Simple Mutt config for using GnuPG via GPGME
# Old-school GPG config was taken from the following docs. I'm preserving these
# links here just in case I need to configure an old version of mutt & gnupg in
# the future without gpgme.
# * /usr/share/docs/mutt/gpg.rc
# * http://codesorcery.net/old/mutt/mutt-gnupg-howto
# * http://dev.mutt.org/trac/wiki/MuttGuide/UseGPG
#
# Mutt now has solid support for GPGME, which not only makes config much
# simpler and eliminates the need to fork gpg processes & parse their output -
# it also makes working with gpg-agent, kwallet, gnome-keyring etc. a doddle
@josephglanville
josephglanville / ruby_image.sh
Created October 21, 2014 11:26
Create bare Ruby docker image
#!/bin/bash
TARGET=$1
mkdir -p $TARGET
files=$(
dpkg -L ruby | grep '/usr/bin/'
dpkg -L ruby1.9.1 | grep '/usr/bin/'
echo '/usr/lib/ruby'
)
@jibsen
jibsen / bytes.md
Last active December 20, 2023 10:02
Ramblings about uint8_t and undefined behavior

Introduction

The C standard only specifies minimum limits for the values of character types and standard integer types. This makes it possible to generate efficient code on diverse architectures, but can pose problematic if your code expects the limits to match your development platform, or if you have to do low-level things.

Before C99, the usual way to solve this was to use typedef to declare synonyms

@francoism90
francoism90 / qemu_win10x64.sh
Last active March 29, 2021 08:54
QEMU + Windows 10 x64 + KVM + IOMMU + AHCI + QXL & SPICE (as socket)
#!/bin/sh
qemu-system-x86_64 -enable-kvm -machine q35,accel=kvm \
-cpu host \
-m 4G \
-drive id=disk,file=/home/archie/Documents/Images/win10x64.img,if=none \
-drive file=/home/archie/Downloads/Win10_1709_English_x64.iso,index=3,media=cdrom \
-drive file=/home/archie/Downloads/drivers.iso,index=4,media=cdrom \
-device intel-iommu \
-device ich9-ahci,id=ahci \
-device ide-drive,drive=disk,bus=ahci.0 \
@kanaka
kanaka / addTwo.wast
Last active June 17, 2021 21:39
Run wast (WebAssembly) in node
(module
(func $addTwo (param i32 i32) (result i32)
(i32.add
(get_local 0)
(get_local 1)))
(export "addTwo" (func $addTwo)))
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# Copyright 2017 Vladislav Mileshkin
# Copyright 2015 Bahtiar `kalkin-` Gadimov <bahtiar@gadimov.de>
# Copyright 2015 Daniel Gultsch <daniel@cgultsch.de>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or