Skip to content

Instantly share code, notes, and snippets.

Avatar

Ryo Murakami xeno14

View GitHub Profile
View sock5
function FindProxyForURL(url, host) {
return "SOCKS localhost:10080";
}
@xeno14
xeno14 / dmmeikaiwa.js
Created Oct 29, 2020
DMM英会話の予定をカレンダーに追加するGoogle Apps Script 2020年10月版
View dmmeikaiwa.js
// 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 Aug 10, 2020
『自作エミュレータで学ぶx86アーキテクチャ』Chapter 3.7で64bit環境でバイナリを生成する場合のtolset_p86/exec-c-test/Makefileの差分
View Makefile.patch
--- 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
View radixsort.cpp
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 Oct 8, 2018
Raspberry Pi用超広角レンズVR220で撮影した画像用を球面上にマップするシェーダー
View VR220Shader.shader
Shader "Unlit/VR220Shader"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "RenderType"="Opaque" }
Cull Front
@xeno14
xeno14 / component.js
Created Aug 16, 2018
aframe component for Motion JPEG streaming
View component.js
// 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 Mar 11, 2018
Bind another IP address in requests
View a.py
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)
View install-docker.sh
#!
#include-once
#include
#cloud-config
#cloud-boothook
sudo apt-get update
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
View Mandelbrot.ipynb
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 Apr 2, 2017
DMM英会話のレッスン予約完了メールをGmailからパースしてGoogleカレンダーに予約するGoogle App Script
View gist:9b16acfe5f3cf8c3ef706249bbda1a41
// 本体
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);
}