Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

ぶーと / Yoshiaki Ueda bootjp

🎯
Focusing
Block or report user

Report or block bootjp

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View twitter_4k_image_opender.js
document.querySelectorAll('img[src*="https://pbs.twimg.com/media/"]').forEach(function(ele) {
// 最初の要素はformatがついていないので
let index = ele.src.indexOf('?');
let url;
if (index !== -1) {
url = ele.src.substr(0, index)
} else {
url = ele.src
}
url += '?format=png&name=4096x4096';
View mongoid_3_multiple_database.txt
If you want to use multiple dbs at once there are several different ways...
1) If you want to do this on a per-model level, use .store_in (This is for all threads):
class Band
include Mongoid::Document
store_in database: "secondary" # This can be any name you want, no need to put it in the mongoid.yml.
end
class Artist
@bootjp
bootjp / bench.go
Last active Mar 22, 2019
golang uuid string vs binary benchmark
View bench.go
package main
import (
"log"
"testing"
"github.com/google/uuid"
)
func uuidString() string {
@bootjp
bootjp / instructions.md
Created Jan 21, 2019 — forked from Ind3xOnGitHub/instructions.md
Oculus Rift + Vive Trackers setup
View instructions.md

Oculus Rift + Vive Trackers setup

It's recommend to use the Vive Trackers 2018 since they have less interference with the Oculus Touch controllers. Also some of the steps are only necessary for the moment because of some bugs and broken tools.

I recommend you to join this Discord server if you have any questions: https://discord.gg/bkRgTVw. You can also check this document for fixes to some common issues.

Written by Ind3x. Thanks to Dj Lukis.LT and Kaori for several additional hints.

  1. Install SteamVR, start it and finish the tutorial if necessary
  2. Open the file Steam\config\steamvr.vrsettings with Windows' Notepad and add the following to the beginning of the steamvr section. Click here to see a short video on how to do that.
@bootjp
bootjp / latency.txt
Created Oct 9, 2018 — forked from eshelman/latency.txt
HPC-oriented Latency Numbers Every Programmer Should Know
View latency.txt
Latency Comparison Numbers
--------------------------
L1 cache reference/hit 1.5 ns 4 cycles
Floating-point add/mult/FMA operation 1.5 ns 4 cycles
L2 cache reference/hit 5 ns 12 ~ 17 cycles
Branch mispredict 6 ns 15 ~ 20 cycles
L3 cache hit (unshared cache line) 16 ns 42 cycles
L3 cache hit (shared line in another core) 25 ns 65 cycles
Mutex lock/unlock 25 ns
L3 cache hit (modified in another core) 29 ns 75 cycles
@bootjp
bootjp / example.cs
Created Sep 22, 2018
non class use nest json.
View example.cs
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
namespace csharp
{
class Program
{
static void Main(string[] args)
{
@bootjp
bootjp / detect_marker.py
Created Apr 30, 2018 — forked from ksasao/detect_marker.py
ZOZOSUITのマーカーのIDを読み取るコードです。公開されている画像を元に独自に解析しているので、公式ではこのように処理しているかどうかは不明です。
View detect_marker.py
import numpy as np
import random
import math
import cv2
from PIL import Image
def detect_markers(im):
markers = []
# 輪郭線抽出のための二値化
im_gray = cv2.cvtColor(im, cv2.COLOR_BGR2GRAY)
@bootjp
bootjp / check_docker_container.sh
Created Jan 10, 2018 — forked from ekristen/check_docker_container.sh
Bash Script for Nagios to Check Status of Docker Container
View check_docker_container.sh
#!/bin/bash
# Author: Erik Kristensen
# Email: erik@erikkristensen.com
# License: MIT
# Nagios Usage: check_nrpe!check_docker_container!_container_id_
# Usage: ./check_docker_container.sh _container_id_
#
# Depending on your docker configuration, root might be required. If your nrpe user has rights
# to talk to the docker daemon, then root is not required. This is why root privileges are not
@bootjp
bootjp / main.go
Created Jan 8, 2018 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
View main.go
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@bootjp
bootjp / bench.kt
Created Nov 15, 2017
Kotlin benchmark String.format vs String.replace
View bench.kt
import org.apache.commons.lang.RandomStringUtils
import java.util.*
fun main(args: Array<String>) {
val tryCount = 1000000
val formatStart = Date()
for (i in 1..tryCount) {
var string = "%s%s%s"
string += RandomStringUtils.randomAlphabetic(10)
val aa = string.format(RandomStringUtils.randomAlphabetic(3), RandomStringUtils.randomAlphabetic(3), RandomStringUtils.randomAlphabetic(3))
You can’t perform that action at this time.