Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View xeno14's full-sized avatar

Ryo Murakami xeno14

View GitHub Profile
@xeno14
xeno14 / sock5
Created December 25, 2020 14:50
function FindProxyForURL(url, host) {
return "SOCKS localhost:10080";
}
@xeno14
xeno14 / dmmeikaiwa.js
Created October 29, 2020 06:17
DMM英会話の予定をカレンダーに追加するGoogle Apps Script 2020年10月版
// 2020年10月版
function DMMCalenderFromGmail() {
// メール本文のパース
function parseBody(body) {
// 開始時間と先生の名前の取得
var matched = body.match(/様、(.*)の(.*)とのレッスン予約が完了しました./);
if (matched.length != 3) {
Logger.log("parse error at teacher and start time");
return null;
@xeno14
xeno14 / Makefile.patch
Created August 10, 2020 10:20
『自作エミュレータで学ぶx86アーキテクチャ』Chapter 3.7で64bit環境でバイナリを生成する場合のtolset_p86/exec-c-test/Makefileの差分
--- Makefile.orig 2020-08-10 18:42:26.102494400 +0900
+++ Makefile 2020-08-10 18:47:55.182494400 +0900
@@ -6,8 +6,9 @@ CC = gcc
LD = ld
AS = nasm
CFLAGS += -nostdlib -fno-asynchronous-unwind-tables \
- -I$(Z_TOOLS)/i386-elf-gcc/include -g -fno-stack-protector
-LDFLAGS += --entry=start --oformat=binary -Ttext 0x7c00
+ -I$(Z_TOOLS)/i386-elf-gcc/include -g -fno-stack-protector \
+ -m32 -march=i386 -fno-pie
template <class IntegralType>
inline size_t idx(IntegralType x, size_t p, size_t d) {
// e.g. p=1 d=2
// 101101 -> 11
return ((x >> (p * d))) & ((1 << d) - 1);
}
template <class BidirectionalIterator>
void radix_sort(BidirectionalIterator first, BidirectionalIterator last,
int d = 8, int w = 64) {
@xeno14
xeno14 / VR220Shader.shader
Last active October 8, 2018 06:26
Raspberry Pi用超広角レンズVR220で撮影した画像用を球面上にマップするシェーダー
Shader "Unlit/VR220Shader"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "RenderType"="Opaque" }
Cull Front
@xeno14
xeno14 / component.js
Created August 16, 2018 09:06
aframe component for Motion JPEG streaming
// https://aframe.io/docs/0.8.0/introduction/writing-a-component.html
AFRAME.registerComponent('box', {
schema: {
width: { type: 'number', default: 1 },
height: { type: 'number', default: 1 },
depth: { type: 'number', default: 1 },
color: { type: 'color', default: '#AAA' }
},
init: function () {
@xeno14
xeno14 / a.py
Created March 11, 2018 01:00
Bind another IP address in requests
import requests
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.poolmanager import PoolManager
class SourceAddressAdapter(HTTPAdapter):
def __init__(self, source_address, **kwargs):
self.source_address = source_address
super(SourceAddressAdapter, self).__init__(**kwargs)
#!
#include-once
#include
#cloud-config
#cloud-boothook
sudo apt-get update
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@xeno14
xeno14 / gist:9b16acfe5f3cf8c3ef706249bbda1a41
Last active April 2, 2017 09:48
DMM英会話のレッスン予約完了メールをGmailからパースしてGoogleカレンダーに予約するGoogle App Script
// 本体
function DMMCalenderFromGmail() {
// prefixとsuffixに挟まれた文字列の取得
function findLine(body, prefix, suffix) {
var istart, iend;
istart = body.indexOf(prefix) + prefix.length;
iend = istart + body.slice(istart).indexOf(suffix);
return body.slice(istart, iend);
}