Skip to content

Instantly share code, notes, and snippets.

@yuiAs
yuiAs / gist:ad8d14da44bb6f354e11
Created April 3, 2014 12:15
SWF DefineBitsJPEG3から取得したデータにcanvas経由でαを適用
util.combineAlphaMask = function(image, mask) {
// drawImage, getImageData, putImageDataは doubleを取るので整数化する
// 仮キャンバス作成,描画
var canvas = document.createElement("canvas");
canvas.width = image.width;
canvas.height = image.height;
var ctx = canvas.getContext("2d");
ctx.drawImage(image, 0|0, 0|0);
@yuiAs
yuiAs / gist:dd3688d211c328ae705b
Created April 3, 2014 12:15
SWF DefineBitsLossles*のfmt=5で取得したARGBからcanvasを作成
util.createBitmapFromARGB = function(data, w, h) {
// drawImage, getImageData, putImageDataは doubleを取るので整数化する
// 仮キャンバス作成,描画
var canvas = document.createElement("canvas");
canvas.width = w;
canvas.height = h;
var ctx = canvas.getContext("2d");
var d = ctx.getImageData(0|0, 0|0, canvas.width, canvas.height);
// ==UserScript==
// @name Tweetdeck Thumbnail from TwitterCards
// @include https://tweetdeck.twitter.com/*
// @version 1.0
// @grant unsafeWindow
// @license MIT License
// ==/UserScript==
(function(){
var TD = unsafeWindow.TD;
ULONG GetZoneProcedure(USHORT Op)
{
ULONG Table = g_Ctx.Addr[VA_ZONETABLE];
__asm
{
mov esi, Table
movsx eax, word ptr [Op]
add eax, 0FFFFFF8Dh
mov edi, [esi+eax*4]
@yuiAs
yuiAs / gununu.cs
Created August 26, 2015 02:16
これだめなん?
bool? a = null;
System.Action<bool> = (b) => { a = b; };
@yuiAs
yuiAs / background.js
Last active November 22, 2015 04:34
艦これ用の何か
(function (_window) {
chrome.runtime.onConnect.addListener(function (port) {
if (port.name == "registerFilters") {
chrome.webRequest.onBeforeRequest.addListener(function (details) {
if (port && details.requestBody) {
port.postMessage({ url: details.url, data: details.requestBody.formData });
}
}, { urls: [ "http://*/kcsapi/api_req_hensei/change" ] }, [ "blocking", "requestBody" ]);
port.onDisconnect.addListener(function () {
// TODO: onBeforeRequest.removeListenerやっておいたほうが無駄に listener残らなくていいかも
@yuiAs
yuiAs / background.js
Last active July 19, 2019 16:54
TweetDeck弄りたい
(function() {
chrome.runtime.onInstalled.addListener(function () {
var rule3 = {
priority: 110,
conditions: [
new chrome.declarativeWebRequest.RequestMatcher({
url: {
hostEquals: 'pbs.twimg.com',
pathContains: '/media/',
queryContains: 'name='
#include <SDKDDKVer.h>
#include <Windows.h>
#include <wincodec.h>
#include <comdef.h>
#include <wrl.h>
HRESULT test()
{
HRESULT hr;
@yuiAs
yuiAs / expand_range.cc
Last active March 9, 2016 11:34
Expand number list with ranges
template <typename T>
std::deque<T> expand_ranges(const std::string& src, size_t limit)
{
std::deque<T> r;
// 現状の parseStringToでは結局分割した std::stringが必要なので先に splitでバラしておく
auto a = split(src, ',');
for (auto it = a.cbegin(); ((it != a.cend()) && (r.size() <= limit)); ++it) {
T v1;
if (parseStringTo<T>(v1, *it) == it->size()) {
@yuiAs
yuiAs / gbf.css
Last active May 27, 2016 14:25
border-image周りで表示がおかしいやつ直して?
*::before {
border-color: transparent;
}
.pop-usual::before, [class^=cnt-]::before, [class^=prt-]::before, [class^=lis-]::before, [id^=prt-]::before {
border-style: solid;
border-width: 0;
}