Skip to content

Instantly share code, notes, and snippets.

static const char *BASE64STR = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
int getBase64Length(int len)
{
return (len+2)/3*4;
}
static void b64(char in1, char in2, char in3, char *out)
{
#define begin {
#define end }
from datetime import datetime
from urllib.parse import quote
from xml.etree import ElementTree
import json
import base64
import os
import os.path
import re
@Koasing
Koasing / TComPicYuv.natvis
Created August 24, 2016 01:37
Image Watch natvis for HEVC HM Reference Software
<?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<UIVisualizer ServiceId="{A452AFEA-3DF6-46BB-9177-C0B08F318025}" Id="1" MenuName="Add to Image Watch"/>
<Type Name="TComPicYuv">
<UIVisualizer ServiceId="{A452AFEA-3DF6-46BB-9177-C0B08F318025}" Id="1" />
</Type>
<Type Name="TComPicYuv">
<DisplayString Condition="m_chromaFormatIDC == CHROMA_400">{{TComPicYuv YUV400 {m_iPicWidth} x {m_iPicHeight} x {m_chromaFormatIDC}}}</DisplayString>
@Koasing
Koasing / deresute_event_simulate.py
Last active September 22, 2016 19:32
デレステ イベントポイント シミュレーター
from datetime import datetime, timedelta
from datetime import time
from copy import deepcopy
# settings
start_date = datetime(2016, 9, 20, 15, 00, 00)
boost_date = datetime(2016, 9, 23, 15, 00, 00)
end_date = datetime(2016, 9, 26, 21, 00, 00)
now_date = deepcopy(start_date)

Windows 7 SP1 Post-install process

Install KB3020369

  • April 2015 servicing stack update for Windows 7 and Windows Server 2008 R2
  • Required for rollup package installer
  • Detail
  • Download Page
@Koasing
Koasing / DropboxCameraUploads.py
Last active December 19, 2016 22:55
Arrange Dropbox Camera Uploads
import os
import os.path as path
import re
from PIL import Image
IMAGE_EXTENSION = ['.jpg', '.jpeg', '.png', '.gif']
CAPTURE_SIZE = [(2048, 1536), (1136, 640)]
SCREEN_RATIO = [w/h if w > h else h/w for w, h in CAPTURE_SIZE]
@Koasing
Koasing / preferred_resolution.md
Last active October 24, 2017 07:19
Change preferred screen resolution of Lubuntu on VMware

Change preferred screen resolution of Lubuntu on VMware

Symptom

On some Display Manager events (login, screen-lock, etc) screen resolution changes to 800x600 forcefully, even though user setting is different.

LightDM's display-setup-script or .config/autostart methods does not fix this problem. These methods changes resolution after specified events by executing xrandr command, but other events (escpecially screen-lock) reset resolution to 800x600 and annoy me.

@Koasing
Koasing / Lubuntu_xrdp.md
Last active March 31, 2018 04:33
Setup xrdp on Lubuntu 17.10

Setup xrdp on Lubuntu 17.10

I recommend Lubuntu to use with xrdp, because Ubuntu's default GUI, Unity, does not work with xrdp. Lubuntu uses LXDE which is compatable with xrdp.

Install xrdp

@Koasing
Koasing / download.py
Created May 16, 2018 09:34
pytube download script
#!/usr/bin/env python3
import argparse
from pytube import YouTube
def download(url):
def progress_callback(stream, chunk, file_handle, bytes_remaining):
# this function is called by download process... do not call directly!
total_size = stream.filesize
downloaded_size = total_size - bytes_remaining