Skip to content

Instantly share code, notes, and snippets.

@yulvil
yulvil / gedmatch_segments.js
Created November 15, 2018 01:15
GEDmatch segments to csv
// Converts
// GEDmatch Matching Segment Search v2.1.2 HTML table
// into
// csv or tsv textarea
javascript:(
function () {
function convert(sep) {
var arr = /Kit:\s*(\w+)\s*\((\w+)\)\s*\(([^)]+)\)/.exec(document.body.innerHTML);
var kit1 = arr[1];
var name = arr[3];
Code Title Stars
DAT327 DynamoDB adaptive capacity: smooth performance for chaotic workl *****
DAT403 Advanced Design Patterns for Amazon DynamoDB xxxxx
IOT402 Engineering the IoT at AWS **
@yulvil
yulvil / scanner.go
Created November 4, 2017 00:22
go scanner modified
https://play.golang.org/p/w63n9akMac
@yulvil
yulvil / gist:d3862e8f57a872602f6b906aead26700
Created November 3, 2017 20:05
regexp c2go ast sqlite3.c
$ c2go ast sqlite3.c | sed 's#^[| -`]*##g' | sed -e 's#0x[0-9a-f]*#0x1#g' -e 's#line:[0-9]*:#line:1:#g' -e 's#col:[0-9]*#col:1#g' -e 's#:1:[0-9]*#:1:1#g' -e 's# used [a-zA-Z0-9_]*# used xyz#' -e 's#\x27[^\x27]*\x27#\x27sss\x27#g' -e 's#1 referenced [a-zA-Z0-9_]*#1 referenced xyz#' -e 's# lvalue ".*# lvalue "str"#g' -e 's# [0-9]*$# 1#' -e 's#:1 [0-9a-zA-Z_]* \x27sss\x27#:1 somefield \x27sss\x27#' -e 's#lvalue \.[0-9a-zA-Z_]* #lvalue \.field#' -e 's#lvalue ->[0-9a-zA-Z_]* #lvalue ->field#' -e 's#struct [0-9a-zA-Z_]\+ definition#struct somestruct definition#' -e 's#union [0-9a-zA-Z_]\+ definition#union someunion definition#' -e 's#<col:[^>]*>#<position>#g' -e 's#<line:[^>]*>#<position>#g' -e 's#<\/usr[^>]*>#<position>#g' | sort -u > /tmp/zz
AlignedAttr 0x1 <position> aligned
array filler
ArraySubscriptExpr 0x1 <position> 'sss' lvalue
ArraySubscriptExpr 0x1 <position> 'sss':'sss' lvalue
AsmLabelAttr 0x1 <position> "creat64"
AsmLabelAttr 0x1 <position> "fallocate64"
AsmLabelAttr 0x1 <position> "fgetpos64"
@yulvil
yulvil / sqlite3warnings
Last active October 31, 2017 00:16
c2go transpile sqlite3.c
$ cat sqlite3.go | grep Warning | gawk -F: '{print $3, $1}' | sort | uniq -c | sort -nr
15016 cannot determine type for RHS, will use 'void *' for all fields // Warning (MemberExpr)
2232 cannot determine type for LHS 'void *', will use 'void *' for all fields // Warning (MemberExpr)
703 cannot determine type for LHS 'YYMINORTYPE', will use 'void *' for all fields // Warning (MemberExpr)
627 cannot determine type for LHS 'void', will use 'void *' for all fields // Warning (MemberExpr)
499 cannot determine size of // Warning (UnaryExprOrTypeTraitExpr)
310 cannot determine type for LHS 'struct SrcList_item *', will use 'void *' for all fields // Warning (MemberExpr)
182 unknown function // Warning (CallExpr)
158 function pointers are not supported // Warning (CallExpr)
@yulvil
yulvil / chromosome-browser-test-data.csv
Created August 29, 2017 22:46
chromosome browser test data
chr start end cm kit name
13 105630320 114127980 11.4 kit0 0.nng006dzxbh
9 126762391 131464364 45.8 kit1 0.x2l1k5eh2n8
20 34267749 39712623 32.2 kit2 0.p2w6oxpecok
12 67544908 78449382 50.8 kit3 0.tkv3h26g7d
23 2645716 6268705 26.1 kit4 0.bv9xdvtw4el
8 81091675 102733079 20 kit5 0.0e1j0obl046g
20 6143648 11405541 22 kit6 0.1cluva1vpqc
16 46894368 55007215 49.4 kit7 0.k7jynjjwesq
9 70554287 77218852 41.3 kit8 0.qfojjnet8ge
@yulvil
yulvil / main.go
Created March 20, 2017 16:31 — forked from zupzup/main.go
Go TCP Proxy / Port Forwarding Example (https://zupzup.org/go-port-forwarding/)
package main
import (
"flag"
"fmt"
"io"
"log"
"net"
"os"
"os/signal"
@yulvil
yulvil / keybase.md
Created February 13, 2017 17:43
keybase proof

Keybase proof

I hereby claim:

  • I am yulvil on github.
  • I am pbcote (https://keybase.io/pbcote) on keybase.
  • I have a public key ASB8GdJAgWHyoPKd-cAnQAEU_XQqF2TbkCoHflY7b9MEyAo

To claim this, I am signing this object:

@yulvil
yulvil / viewjsdemo.html
Last active August 31, 2023 07:00
vue.js example with button on-click event
<html>
<head>
<script src="https://unpkg.com/vue/dist/vue.js"></script>
</head>
<body>
<div id="example">
<form action="javascript:void(0);">
<button v-on:click="dosomething">Add 1</button>
{{ counter }} {{ message }}