Skip to content

Instantly share code, notes, and snippets.

James Swineson Jamesits

Block or report user

Report or block Jamesits

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
#!/usr/bin/env python3
import logging
import typing
import os
import shutil
import time
import requests
from bs4 import BeautifulSoup
# logging
Jamesits /
Created Oct 28, 2018
OpenSUSE basic customization
sudo zypper addrepo
sudo zypper in autoconf automake sassc pkg-config gtk3-devel gnome-themes-standard gtk2-engine-murrine numix-icon-theme
git clone --depth 1 && cd arc-flatabulous-theme
./ --prefix=/usr
sudo make install
Jamesits /
Created Sep 4, 2018
Update dynamic DNS entry on CloudFlare
set -eu
# account config
# record config
Jamesits / nds.log
Last active May 1, 2018
DSLinux boot dmesg - iQue DS lite, M3 Lite Professional MicroSD expension card
View nds.log
Linux version 2.6.14-hsc0ds (stsp@len) (gcc version 4.0.4) #5 Mon Feb 27 17:02:50 CET 2012
CPU: ARM946E [41009460] revision 0 (ARMvundefined/unknown)
Machine: Nintendo DS
Memory management: Non-Paged(unused/noMMU)
Ignoring unrecognised tag 0x00000000
On node 0 totalpages: 9216
DMA zone: 9216 pages, LIFO batch:3
Normal zone: 0 pages, LIFO batch:1
HighMem zone: 0 pages, LIFO batch:1
CPU0: D VIVT write-back cache
Jamesits / high-frequency-square-wave-generator-esp8266.ino
Last active Oct 27, 2019
High-accuracy square wave generator (up to 250KHz) based on ESP8266, with runtime adjustable frequency, PWM width and offset.
View high-frequency-square-wave-generator-esp8266.ino
// High-accuracy square wave generator
// based on ESP8266
// with runtime adjustable frequency, PWM width and offset
// Output wave at pin 5 (configurable from 0 to 15, but not 16)
// by James Swineson <>, 2017-10
// See
// for more information (article in Chinese)
// Arduino UNO version:
Jamesits / preload.cpp
Created Sep 8, 2017 — forked from m13253/preload.cpp
Preload files into memory cache, for example IME database, in case you have a slow HDD.
View preload.cpp
#include <windows.h>
#include <string>
using namespace std::string_literals;
constexpr size_t buffer_size = 64*1024;
static char buffer[buffer_size];
static DWORD PrintString(HANDLE h_stdout, std::wstring const& string) {
DWORD count;
Jamesits /
Created Aug 23, 2017
Docker cleanup unused things
#!/usr/bin/env bash
# remove all exited containers
docker rm $(docker ps -a -f status=exited -f status=created -q)
# remove dangling volumes
docker volume rm $(docker volume ls -f dangling=true -q)
set -eu
# check root
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
Jamesits / MacType-James.ini
Last active Oct 12, 2019
My MacType profile, optimized for Telegram UWP and something else.
View MacType-James.ini
; Please see
; for instruction.
; Author: James Swineson <>
Name=James Profile
; 【启用 DirectWrite 支持】
; [0:Disable] 1:Enable
Jamesits /
Last active Apr 12, 2017
Python 3 Pillow 把图像转换成灰度
#!/usr/bin/env python3
import sys
from PIL import Image
# 载入图像
im =[1])
def makeGrayscale(im: 'Image.Image') -> 'Image.Image':
'''Reads a Pillow image and convert it to grayscale using brightness'''
You can’t perform that action at this time.