Skip to content

Instantly share code, notes, and snippets.

View tanishiking's full-sized avatar
🤖

Rikito Taniguchi tanishiking

🤖
View GitHub Profile
#include <libunwind.h>
#include <stdio.h>
// Call this function to get a backtrace.
void backtrace() {
unw_cursor_t cursor;
unw_context_t context;
// Initialize cursor to current frame for local unwinding.
unw_getcontext(&context);
This file has been truncated, but you can view the full file.
--- before 2023-04-20 14:27:08
+++ after 2023-04-20 14:28:58
@@ -5,33 +5,33 @@
ret unit
}
var @"M4MainG4type" : {{ptr, int, int, ptr}, int, int, {ptr}, [ptr x 4]} = structvalue {structvalue {@"M15java.lang.ClassG4type" : ptr, int 639, int -1, const structvalue {@"M16java.lang.StringG4type" : ptr, const structvalue {@"M35scala.scalanative.runtime.CharArrayG4type" : ptr, int 4, int 0, arrayvalue char {char 77, char 97, char 105, char 110}}, int 0, int 4, int 2390489}}, int 8, int 639, structvalue {const arrayvalue long {long -1}}, arrayvalue ptr {@"M16java.lang.ObjectD12scala_$eq$eqL16java.lang.ObjectzEO" : ptr, @"M16java.lang.ObjectD8toStringL16java.lang.StringEO" : ptr, @"M16java.lang.ObjectD8hashCodeiEO" : ptr, @"M16java.lang.ObjectD6equalsL16java.lang.ObjectzEO" : ptr}}
-didopt def @"M5Main$D10$anonfun$1L28scala.scalanative.unsafe.PtriEPT5Main$" : (@"T5Main$", @"T28scala.scalanative.unsafe.Ptr") => int {
-%3000000(%1 : @"T5Main$", %2 : @"T28scala.scalanative.unsafe.Ptr"):
- %3000004 = ine[@"T5Main$"]
package dotty.tools.dotc
package transform
import ast.{TreeTypeMap, tpd}
import config.Printers.tailrec
import core.*
import Contexts.*, Flags.*, Symbols.*
import Constants.Constant
import NameKinds.{TailLabelName, TailLocalName, TailTempName}
import StdNames.nme
#!/usr/bin/env -S scala-cli shebang --quiet
//> using lib "com.softwaremill.sttp.client3::core:3.8.3"
//> using lib "com.lihaoyi::os-lib:0.8.1"
//> using lib "com.mitchtalmadge:ascii-data:1.4.0"
//> using lib "com.lihaoyi::ujson:2.0.0"
// 147.47 ┤ ╭╮ ╭──╮ ╭─╮
// 146.52 ┤ ╭╯╰─╮ │ │╭─╯ ╰╮ ╭─╮╭──╮
// 145.56 ┤ │ ╰──╯ ╰╯ ╰╮│ ╰╯ │ ╭──╮╭─╮
  • (easy) Enables metals-vscode to fire textDocument/*
  • Adjust the LSP request position to the actual source position (generated by almond / ammonite)
    • How to know the URI of generated Scala file for the ipynb? Can we get that information from running Kernel somehow?
    • How to map "uri of notebook cell" + "position inside the cell" to the position of generated Scala source file?

Enables metals-vscode to fire textDocument/*

According to notebookCellTextDocumentFilter of LSP 3.17. We can enable vscode to fire textDocument/* for all jupyter-notebook, where the Cell's language is Scala.

@tanishiking
tanishiking / aho-corasick.ts
Last active May 16, 2020 04:48
Naive implementation of AhoCorasick in TypeScript
interface State {
id: number
next: { [key: string]: State }
}
function hasKey(state: State, char: string): boolean {
return !!state.next[char]
}
export class AhoCorasick {
state: State[] = [{ id: 0, next: {} }]

Pub/Sub push endpoint の JWT 検証流れ

#GCP #GAE #Pub/Sub

メモ: image 2020/4/14

参考

10 Swamp (RIX) 194
8 Island (RIX) 193
4 Death Baron (M19) 90
2 Diregraf Ghoul (M19) 92
2 Doomed Dissenter (M19) 93
2 Soul Diviner (WAR) 218
3 Eternal Taskmaster (WAR) 90
3 Lazotep Plating (WAR) 59
3 Aven Eternal (WAR) 42
4 Dimir Guildgate (GRN) 245
CREATE TABLE `blog` (
`id` BIGINT UNSIGNED NOT NULL,
`title` VARCHAR(512) NOT NULL,
`content` TEXT NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
@tanishiking
tanishiking / typesafe_config_load_memo.md
Created November 26, 2018 09:05
Type safe config のコード呼んだときのメモ