This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
void fizz(int num) | |
{ | |
printf("%s\n", "Fizz"); | |
} | |
void buzz(int num) | |
{ | |
printf("%s\n", "Buzz"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#required x86-64 linux | |
#as -o hello.o hello.s | |
#ld -o hello -dynamic-linker (path to ld-linux...) hello.o | |
#./hello | |
.global hello | |
.global _start | |
.data | |
hello: | |
.string "Hello world!\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#|-*- mode:lisp -*-|# | |
#| | |
exec ros -Q -- $0 "$@" | |
|# | |
(progn ;;init forms | |
(ros:ensure-asdf) | |
;;#+quicklisp (ql:quickload '() :silent t) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define (split str delim) | |
(define (skip-delimiter s) | |
(if (and (pair? s) (memv (car s) delim)) | |
(skip-delimiter (cdr s)) | |
s)) | |
;string -> token remainder | |
(define (get-token s acc) | |
(if (or (null? s) (memv (car s) delim)) | |
(values (reverse acc) s) | |
(get-token (cdr s) (cons (car s) acc)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Wikipediaの色相環の項目の虹色 | |
const s:colors = ['FF0000', 'FF4000', 'FF8000', 'FFBF00', 'FFFF00', 'BFFF00', '80FF00', '40FF00', '00FF00', '00FF40', '00FF80', '00FFBF', '00FFFF', '00BFFF', '0080FF', '0040FF', '0000FF', '4000FF', '8000FF', 'BF00FF', 'FF00FF', 'FF00BF', 'FF0080', 'FF0040'] | |
const s:looper = range(1, 300) | |
"色付けされた行 | |
let s:painted = 0 | |
function! s:paintline(line) abort | |
for i in s:looper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! BF(fxxk) abort | |
let mem = 0z00 | |
for i in range(15) | |
let mem = mem + mem | |
endfor | |
let ip = 0 | |
let dp = 0 | |
let out = [] | |
while ip < len(a:fxxk) | |
let c = a:fxxk[ip] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" ws以外の全ての関数は[result, newpos]を返す | |
function! s:object(in, pos) abort | |
let p = s:ws(a:in, a:pos + 1) | |
if a:in[p] == 125 " } | |
return [{}, p + 1] | |
endif | |
let acc = {} | |
while v:true | |
let [r, p] = s:member(a:in, p) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! s:status() abort | |
let repo = finddir(".git", expand("%:p:h") .. ";") | |
if !empty(repo) | |
let repo = fnamemodify(repo, ":p") | |
let root = fnamemodify(repo, ":h:h") " ディレクトリ名が展開された場合末尾に/が付く | |
execute "tcd" root | |
Gina status -s | |
else | |
throw "Not a git repository." | |
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -u | |
tmp=$(mktemp -d) | |
atexit() { | |
sudo rm -rf ${tmp} | |
} | |
trap atexit EXIT | |
addrepo() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let s:ops = {"line":"V", "char":"v", "block":"\<C-v>"} | |
function! DoNoSpaceYank(wise) abort | |
let from = getpos("'[") | |
let to = getpos("']") | |
let visualop = s:ops[a:wise] | |
call inputsave() | |
keepjumps call setpos(".", from) | |
keepjumps call feedkeys(visualop, "nx") |
OlderNewer