Skip to content

Instantly share code, notes, and snippets.

#! /usr/bin/env python3
from saklient.cloud.api import API
import subprocess
from pprint import pprint
import re
def get_ipaddr(iface):
m = re.search(
@7kry
7kry / global.mo.0.6.2.0.po
Created March 12, 2017 07:06
WoWsの日本語メッセージ
msgid ""
msgstr ""
"#-#-#-#-# ACHIEVEMENTS.po (World Of WarshipsReport-Msgid-Bugs-To: MIME-"
"Version: 1.0Content-Type: text/plain; charset=utf-8) #-#-#-#-#\n"
"Project-Id-Version: World Of WarshipsReport-Msgid-Bugs-To: MIME-Version: "
"1.0Content-Type: text/plain; charset=utf-8\n"
"#-#-#-#-# ARMOR.po (World Of WarshipsReport-Msgid-Bugs-To: MIME-Version: "
"1.0Content-Type: text/plain; charset=utf-8) #-#-#-#-#\n"
"Project-Id-Version: World Of WarshipsReport-Msgid-Bugs-To: MIME-Version: "
"1.0Content-Type: text/plain; charset=utf-8\n"
@7kry
7kry / fuckinJPEG.py
Last active February 28, 2017 12:02
JPEGで保存されたファッキンJPEGな塗り絵用線画を透過するスクリプト。強制的に線画はモノクロになるので注意。
#! /usr/bin/env python3
from PIL import Image
import sys
import itertools
src, dst = sys.argv[1:3]
src = Image.open(src)
img = Image.new("LA", src.size)
@7kry
7kry / screen_grab_win.cpp
Last active February 10, 2017 16:32 — forked from philip-goh/screen_grab.cpp
Take a screenshot and write it out as a JPEG in C++ on Windows
#include <iostream>
#include <windows.h>
#include <gdiplus.h>
#include <memory>
using namespace Gdiplus;
using namespace std;
int GetEncoderClsid(const WCHAR* format, CLSID* pClsid)
{
#! /usr/bin/env python3
import subprocess
import time
import datetime
import sys
interval = float(sys.argv[1])
while True:
@7kry
7kry / each_slice.py
Created December 26, 2016 04:19
PythonでRubyっぽいeach_sliceがしたいときのためのスニペット
def each_slice(iterable, nslice):
from itertools import groupby, repeat
for _, g in groupby(enumerate(iterable), lambda elem: elem[0] // nslice):
yield map(tuple.__getitem__, g, repeat(1))
(function(){
if(document.location.href != 'http://www.pixiv.net/'){
location.href = 'http://www.pixiv.net/';
return;
}
function choose(urls, choosed){
if(urls.length < 1){
Array.prototype.push.apply(urls, choosed);
choosed.length = 0;
}
@7kry
7kry / .gitignore
Last active December 25, 2015 14:51
*.pyc
//javascript:
(function(){ $('.dashboard,.global-nav,.timeline-tweet-box').remove(); $('#page-container,#page-outer,div[role="main"]').css({marigin: '0 0 0 0', padding: '0 0 0 0', width: '100%'}); setInterval(function(){ $('.new-tweets-bar').click() }, 1000) })()
(function(){
if(!location.href.match(/^https?:\/\/p\.eagate\.573\.jp\//)){
alert('e-AMUSEMENT GATEから実行し直してください。');
location.href = 'http://p.eagate.573.jp/game/2dx/22/p/djdata/status.html';
return;
}
const CURRENT = 22; // IIDX 22 PENDUAL
const CLASSES = [[0, 0], [0, 1], [0, 2], [0, 3], [0, 4], [0, 5], [0, 6], [0, 7], [0, 8], [0, 9], [0, 10], [0, 11], [0, 12], [0, 13], [0, 14], [0, 15], [0, 16], [0, 17], [1, 0], [1, 1], [1, 2], [1, 3], [1, 4], [1, 5], [1, 6], [1, 7], [1, 8], [1, 9], [1, 10], [1, 11], [1, 12], [1, 13], [1, 14], [1, 15], [1, 16], [1, 17]];