Skip to content

Instantly share code, notes, and snippets.

View poizan42's full-sized avatar

Kasper Fabæch Brandt poizan42

View GitHub Profile
@poizan42
poizan42 / .config
Last active August 20, 2019 15:01
crosstool-ng#962 failure
#
# Automatically generated file; DO NOT EDIT.
# crosstool-NG Configuration
#
CT_CONFIGURE_has_static_link=y
CT_CONFIGURE_has_cxx11=y
CT_CONFIGURE_has_wget=y
CT_CONFIGURE_has_make_3_81_or_newer=y
CT_CONFIGURE_has_make_4_0_or_newer=y
CT_CONFIGURE_has_libtool_2_4_or_newer=y
@poizan42
poizan42 / explodeUtf8.sml
Last active September 28, 2018 13:49
UTF-8 decoder in Standard ML
exception Encoding of string;
local
fun decodeUtf8Chars nil = nil
| decodeUtf8Chars (c::rest) =
if c < #"\128" then (ord c)::(decodeUtf8Chars rest)
else
let
val cn = ord c
(* 0xF4 is the largest allowed start byte after the restriction
@poizan42
poizan42 / Excluded.cs
Last active September 5, 2018 06:37
Project with excluded cs file testcase for https://github.com/hvanbakel/CsprojToVs2017/issues/190
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ExcludedFileTest
{
I do not compile!
class Excluded
Makefile:126: The docker client CLI has moved to github.com/docker/cli. For a dev-test cycle involving the CLI, run:
DOCKER_CLI_PATH=/host/path/to/cli/binary make shell
then change the cli and compile into a binary at the same location.
docker build -t "docker-dev:master" -f "Dockerfile" .
Sending build context to Docker daemon 251.1MB
Step 1/94 : FROM golang:1.10.3 AS base
---> 4e611157870f
Step 2/94 : ENV GO_VERSION 1.10.3
@poizan42
poizan42 / MailSend.cs
Created June 14, 2018 16:18
Demonstration of bad heuristics in som AV products, old-style .csproj edition, see https://poizan.dk/blog/2018/06/14/the-dangerous-mailsend-antivirus-heuristics-fail/
class Program
{
public const string pad =
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" +
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" +
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" +
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" +
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" +
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" +
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" +
@poizan42
poizan42 / MailSend.cs
Last active June 14, 2018 16:15
Demonstration of bad heuristics in som AV products, new-style .csproj edition, see https://poizan.dk/blog/2018/06/14/the-dangerous-mailsend-antivirus-heuristics-fail/
class Program
{
public const string pad =
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" +
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" +
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" +
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" +
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" +
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" +
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" +
private static FrameworkPropertyMetadata CloneFrameworkPropertyMetadata(FrameworkPropertyMetadata src)
{
FrameworkPropertyMetadataOptions options = FrameworkPropertyMetadataOptions.None;
if (src.AffectsArrange)
options |= FrameworkPropertyMetadataOptions.AffectsArrange;
if (src.AffectsMeasure)
options |= FrameworkPropertyMetadataOptions.AffectsMeasure;
if (src.AffectsParentArrange)
options |= FrameworkPropertyMetadataOptions.AffectsParentArrange;
if (src.AffectsParentMeasure)
@poizan42
poizan42 / MoveAnyFile.ps1
Created November 24, 2017 13:37
PowerShell script for moving / renaming files with otherwise invalid filenames
param([String]$existingFilename, [String]$newFilename)
$signature = @'
[DllImport("kernel32.dll", ExactSpelling=true, CharSet=CharSet.Unicode, SetLastError=true)]
public static extern uint MoveFileW(
string lpExistingFileName, string lpNewFileName);
'@
$type = $null
try
@poizan42
poizan42 / fix-spinny.py
Last active January 30, 2018 18:54
Update links to Spinnerette comics to current format
import sys
from datetime import datetime
import re
import urllib2
from bs4 import BeautifulSoup
wayback_prefix = 'https://web.archive.org/web/20160824022930/'
newformat_prefix = 'http://www.spinnyverse.com/comic/'
cachef = open('spinny-cache', 'a+')
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.