Skip to content

Instantly share code, notes, and snippets.

View laysakura's full-sized avatar

Sho Nakatani laysakura

View GitHub Profile
@laysakura
laysakura / jsx_json_twitter
Created September 2, 2012 05:58
Cannot parse it as a JSON
var tweetJsonStr =
'{\n' +
' "results": [\n' +
' {\n' +
' "text": "\u58f2\u308bSale\u305c\u3088\uff01\u30bd\u30d5\u30c8\u30d0\u30f3\u30af\uff01 \u25a0\u8a2d\u7acb1976\u5e7411\u670825\u65e5\uff6536\u671f\u306e\u30bd\u30d5\u30c8\u30d0\u30f3\u30af\u682a\u5f0f\u4f1a\u793e\u3092\u58f2\u308a\u307e\u3059\uff01\u3000\u25a0\u7fa9\u63f4\u91d1\u637b\u51fa\u306e\u305f\u3081\u58f2\u308a\u307e\u3059\uff01\uff01\n\u25a0\u308f\u304c\u793e\u3088\u308a\u53e4\u3044\u30bd\u30d5\u30c8\u30d0\u30f3\u30af\u3001\u3054\u5b58\u77e5\u3067\u3059\u304b\uff1f\n2012/9/2 11:56", \n' +
' "from_user_name": "\u30bd\u30d5\u30c8\u30d0\u30f3\u30af", \n' +
' "profile_image_url": "http://a0.twimg.com/profile_images/1851931672/SB__8_normal.png", \n' +
' "created_at": "Sun, 02 Sep 2012 02:56:41 +0000" \n' +
' } \n' +
' ] \n' +
@laysakura
laysakura / wrap-region-by-string
Created September 9, 2012 05:20
選択範囲の前後に文字列を挿入するelisp
; Bind key command like this:
; (global-set-key "\C-xw" 'wrap-region-by-string)
; Then mark text (C-SPC or C-@) and put "Ctrl-x w"
; Enjoy!
(defun wrap-region-by-string ()
(interactive
(let ((start-point (region-beginning))
(end-point (region-end))
(start-str (read-string "Start: " nil 'my-history))
(gdb) bt
#0 0x0000003e5460be32 in pthread_kill () from /lib64/libpthread.so.0
#1 0x000000000066aeea in handle_fatal_signal (sig=11) at /home/nakatani/git/mysql-5.6.10/sql/signal_handler.cc:248
#2 <signal handler called>
#3 0x0000000000b3101b in my_hash_sort_bin (cs=<value optimized out>, key=0xf99e159ad150a47c <Address 0xf99e159ad150a47c out of bounds>, len=5248597205062286336, nr1=0x2ad13f0c1828, nr2=0x2ad13f0c1820) at /home/nakatani/git/mysql-5.6.10/strings/ctype-bin.c:307
#4 0x00000000008dc1e7 in calc_hash (hash=<value optimized out>, key=0x2ad13f0c26c0 "\035%\f?\321*", length=5248597205062286336) at /home/nakatani/git/mysql-5.6.10/mysys/hash.c:46
#5 my_calc_hash (hash=<value optimized out>, key=0x2ad13f0c26c0 "\035%\f?\321*", length=5248597205062286336) at /home/nakatani/git/mysql-5.6.10/mysys/hash.c:232
#6 0x00002ad0a694a1a8 in load_table (this=0x16493f00) at ha_queue.cc:613
#7 queue_share_t::init_fixed_fields (this=0x16493f00) at ha_queue.cc:878
#8 0x00002ad0a694e1be in get_share_check (db_tabl
@laysakura
laysakura / -
Created January 10, 2014 03:32
Gist (v4.2.0) lets you upload to https://gist.github.com/
The content to be uploaded can be passed as a list of files, if none are
specified STDIN will be read. The default filename for STDIN is "a.rb", and all
filenames can be overridden by repeating the "-f" flag. The most useful reason
to do this is to change the syntax highlighting.
If you'd like your gists to be associated with your GitHub account, so that you
can edit them and find them in future, first use `gist --login` to obtain an
Oauth2 access token. This is stored and used by gist in the future.
@laysakura
laysakura / -
Created March 14, 2014 05:25
ScanSnap S1500
#!/bin/sh
## Scan documents with ScanSnap 1500S.
##
## (1) Set documents to ScanSnap
## (2) Run this command
##
## This file is uploaded to gist:
## https://gist.github.com/9542556
@laysakura
laysakura / poc_parallel_query_executor.md
Last active August 29, 2015 14:15
並列クエリ処理のPoC

構成要素

  • Records

    • Columns & get_columns(size_t i_column) - Columnsは1カラムのデータ集合: (1, 3, 55) みたいな
  • Columns

    • ColumnType (struct)
    • 本質的なデータはBufferの中に => 1個のデータがアホみたいに大きくない限りは、キャッシュサイズにギリギリ収まるだけのカラムを入れるようにする
  • PlanTree

@laysakura
laysakura / jenkins-header-color-green.css
Last active July 7, 2017 04:43
Jenkinsのヘッダー帯: 緑
.top-sticker-inner {
background-color: #77e8a4!important;
}
@laysakura
laysakura / 01-commands-on-your-host.bash
Last active February 8, 2020 08:20
Running benchmarks in riscv/riscv-tests using a RISC-V emulator `Spike`
docker build -t spike:latest .
docker run -it spike:latest bash
@laysakura
laysakura / cloudSettings
Last active March 23, 2020 03:11
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-03-23T03:11:38.527Z","extensionVersion":"v3.4.3"}
@laysakura
laysakura / main.rs
Last active January 19, 2021 02:21
tarpc !Sync server
// [dependencies]
// futures = "0.3"
// tarpc = {version = "0.24", features = ["full"]}
// tokio = {version = "1.0", features = ["macros"]}
use futures::{
future::{self},
prelude::*,
};
use std::{