Skip to content

Instantly share code, notes, and snippets.

🔌
charging motivation.

ぶーと / Yoshiaki Ueda bootjp

🔌
charging motivation.
View GitHub Profile
View user_list.yml
- "name": "-お布団-"
"screen_name": "@Ohuton5732"
- "name": "-トオル-"
"screen_name": "@Toru_rzr"
- "name": ".HISAKUN"
"screen_name": "@hisakunsan"
- "name": "105bank"
"screen_name": "@105bank"
- "name": "27Cobalter"
"screen_name": "@27Cobalter"
@bootjp
bootjp / bench.py
Last active May 17, 2020
python list vs. set add and remove opration.
View bench.py
import time
sset = set()
arr = []
def main():
for _ in range(3):
start = time.time()
for i in range(50):
View bench.py
import time
import re
def tail(thefile):
# thefile.seek(0, 2)
while True:
line = thefile.readline()
if not line:
time.sleep(0.5)
@bootjp
bootjp / JavaScript.md
Created Apr 26, 2020 — forked from kenmori/JavaScript.md
JavaScript練習問題集(ECMAScript2015,2016,2017,2018,2019,2020,other Library)
View JavaScript.md

JavaScript練習問題集

JavaScript

更新情報

・問題を追加(2020/4/18)
・表記揺れを整理(2020/1/13)
・TypeScript問題集のリンク追加(2019/7/13)
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)
{
You can’t perform that action at this time.