Skip to content

Instantly share code, notes, and snippets.

@suzusime
suzusime / import-all-deno-std.ts
Last active April 10, 2024 17:20
Import All deno std@0.221.0
// #region import_std
import * as archive from "https://deno.land/std@0.221.0/archive/mod.ts";
import * as assert from "https://deno.land/std@0.221.0/assert/mod.ts";
import * as async from "https://deno.land/std@0.221.0/async/mod.ts";
import * as bytes from "https://deno.land/std@0.221.0/bytes/mod.ts";
import * as cli from "https://deno.land/std@0.221.0/cli/mod.ts";
import * as collections from "https://deno.land/std@0.221.0/collections/mod.ts";
import * as std_console from "https://deno.land/std@0.221.0/console/mod.ts";
import * as crypto from "https://deno.land/std@0.221.0/crypto/mod.ts";
import * as csv from "https://deno.land/std@0.221.0/csv/mod.ts";
@suzusime
suzusime / main.rs
Created May 20, 2021 15:45
『ゲームプログラミングC++』の第一章をもとにrust-sdl2で書いたもの
extern crate sdl2;
use sdl2::event::Event;
use sdl2::keyboard::Keycode;
use sdl2::pixels::Color;
use std::time::Duration;
struct Game {
sdl_context: sdl2::Sdl, // SDL全体オブジェクト
canvas: sdl2::render::Canvas<sdl2::video::Window>, // Rendererの代わり
}
@suzusime
suzusime / scraping.pl
Created May 7, 2019 18:49
スクレイピングする簡単な例
#!/usr/bin/env perl
use strict;
use warnings;
use 5.014;
use utf8;
use open ':encoding(utf8)';
use Encode::Locale;
binmode(STDIN, ":encoding(console_in)");
binmode(STDOUT, ":encoding(console_out)");
binmode(STDERR, ":encoding(console_out)");
@suzusime
suzusime / _template.pl
Last active December 24, 2020 16:14
perlでスクリプトを書くときのテンプレ
#!/usr/bin/env perl
use strict;
use warnings;
use 5.014;
use utf8;
use open ':encoding(UTF-8)';
use Encode::Locale;
binmode(STDIN, ":encoding(console_in)");
binmode(STDOUT, ":encoding(console_out)");
binmode(STDERR, ":encoding(console_out)");
@suzusime
suzusime / cps.ml
Last active May 3, 2019 09:04
継続渡し形式への変換例
(* Example of Continuation Passing Style *)
(* cf. http://practical-scheme.net/docs/cont-j.html *)
type tree =
Leaf
| Node of int * tree * tree
;;
let rec sum_nodes t =
match t with
### Keybase proof
I hereby claim:
* I am suzusime on github.
* I am suzusime (https://keybase.io/suzusime) on keybase.
* I have a public key ASB5EYaMSvgqcXvLaomoEYpNhg50fJYXEErZQQQie1FSxQo
To claim this, I am signing this object:
@suzusime
suzusime / vue-sample.html
Created October 14, 2018 18:25
vue.jsのてすと
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<div id="app">
{{ message }}
</div>
<div id="app-2">
@suzusime
suzusime / index.html
Created October 5, 2018 09:22
sample_vue
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<div id="app">
{{ message }}
</div>
<div id="app-2">
if exists('b:did_ftplugin_tex_flag')
finish
endif
let b:did_ftplugin_tex_flag = 1
scriptencoding utf-8
" 数式用のキーマップに設定する函数
:function! s:SetKeyMap()
:ino <buffer> B@ B
:ino <buffer> B<Space> B<Space>
@suzusime
suzusime / vigenere3d.py
Created December 11, 2017 21:17
SECCON 2017 Online CTF - Vigenere3d
s = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz_{}"
#鍵を無理やり求めるやつ
def sa(s1,s2):
c = []
for i in range(7):
i1 = s.find(s1[i])
i2 = s.find(s2[i])
c.append(i1-i2)
return c