Skip to content

Instantly share code, notes, and snippets.

View rhysd's full-sized avatar
🐕
Fixing an off-by-wan error

Linda_pp rhysd

🐕
Fixing an off-by-wan error
View GitHub Profile

NES emulator development guide

Overview of document

// https://wicg.github.io/IntersectionObserver/#intersection-observer-private-slots
/*
callback IntersectionObserverCallback = void (sequence<IntersectionObserverEntry> entries, IntersectionObserver observer)
[Constructor(IntersectionObserverCallback callback, optional IntersectionObserverInit options),
Exposed=Window]
interface IntersectionObserver {
readonly attribute Element? root;
readonly attribute DOMString rootMargin;
@rhysd
rhysd / zatsu.rb
Last active March 17, 2023 17:40
#!/usr/bin/env ruby
# encoding: utf-8
#
# 絵文字の内部符号とそれに対応する絵文字の意味を日本語で抜き出すスクリプト
require 'open-uri'
require 'pp'
URLs = %w(
http://seesaawiki.jp/w/qvarie/d/%a5%e6%a5%cb%a5%b3%a1%bc%a5%c96.0%b0%ca%b9%df%a4%c7%bb%c8%cd%d1%a4%c7%a4%ad%a4%eb%b3%a8%ca%b8%bb%fa%28%bc%ab%c1%b3%ca%d4%29
@rhysd
rhysd / chained.js
Last active October 30, 2022 11:48
How to create Iterable object which chains JavaScript Iterator objects
function chained(...iterators) {
return {
[Symbol.iterator]() {
return {
next() {
if (iterators.length === 0) {
return { done: true };
}
const result = iterators[0].next();
diff --git a/lib/Frontend/InitHeaderSearch.cpp b/lib/Frontend/InitHeaderSearch.cpp
index 3691adf..cf3c3a7 100644
--- a/lib/Frontend/InitHeaderSearch.cpp
+++ b/lib/Frontend/InitHeaderSearch.cpp
@@ -353,6 +353,9 @@ AddDefaultCPlusPlusIncludePaths(const llvm::Triple &triple, const HeaderSearchOp
case llvm::Triple::ppc:
case llvm::Triple::ppc64:
+ AddGnuCPlusPlusIncludePaths("/usr/local/lib/c++/v1",
+ "i686-apple-darwin10", "", "ppc64",
@rhysd
rhysd / pre-push
Created December 1, 2018 15:53
pre-push check script in .git/hooks for Go project
#!/bin/bash
# An example hook script to verify what is about to be pushed. Called by "git
# push" after it has checked the remote status, but before anything has been
# pushed. If this script exits with a non-zero status nothing will be pushed.
#
# This hook is called with the following parameters:
#
# $1 -- Name of the remote to which the push is being done
# $2 -- URL to which the push is being done
@rhysd
rhysd / calc.cpp
Created December 13, 2012 09:20
representation for expression tree using boost::variant
#include <iostream>
#include <string>
#include <boost/variant/variant.hpp>
#include <boost/variant/recursive_wrapper.hpp>
#include <boost/variant/static_visitor.hpp>
#include <boost/variant/apply_visitor.hpp>
struct add_tag{ static char const* symbol(){ static char const* s = "+"; return s; } };
@rhysd
rhysd / js_run.js
Last active November 27, 2019 05:05
benchmark JSON vs JS Object
const d = {
lastUpdate: 1574785732173,
entries: {
'Rust Benchmark': [
{
commit: {
author: {
email: 'lin90162@yahoo.co.jp',
name: 'rhysd',
username: 'rhysd',
; ModuleID = 'foo.c'
source_filename = "foo.c"
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.12.0"
; Function Attrs: noinline nounwind ssp uwtable
define i32 @main() #0 {
%1 = alloca i32, align 4
%2 = alloca i32, align 4
store i32 0, i32* %1, align 4
@rhysd
rhysd / cmd
Created August 11, 2018 02:02
setjmp/longjmp test
emcc main.c --js-library main.js -o hello.html -s "EXTRA_EXPORTED_RUNTIME_METHODS=['ccall']"