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
import random | |
print('ぬん') | |
letters = { | |
'し': {'population': ['か', 'た'], 'weights': [0.5, 0.5]}, | |
'か': {'population': ['の'], 'weights': [1]}, | |
'の': {'population': ['こ'], 'weights': [1]}, | |
'こ': {'population': ['の', 'こ', 'し'], 'weights': [0.5, 0.25, 0.25]}, | |
'た': {'population': ['ん'], 'weights': [1]}, |
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:infs(...) | |
call setloclist(0, [], ' ', #{title: 'infs: ', quickfixtextfunc: function('s:infs_text')}) | |
lopen | |
wincmd p | |
redraw | |
augroup infs-input | |
autocmd CmdlineChanged @ call s:udpate_loclist(getcmdline()) | |
augroup END | |
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:dice(count, dice) abort | |
const dices = map(range(a:count), {-> rand() % a:dice + 1}) | |
echo dices | |
if a:count <=# 1 | |
return | |
endif | |
echo 'sum:' reduce(dices, {acc, val -> acc + val}) | |
endfunction | |
command! -range=1 -addr=other -nargs=1 -bar D call s:dice(<count>, <args>) |
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
vim9script | |
var hue: number = 0 | |
def Update(timer: number) | |
hue += 64 | |
hue %= 1536 | |
var r: number = abs(hue - 768) - 256 | |
var g: number = abs(Mod((hue - 512), 1536) - 768) - 256 | |
var b: number = abs(Mod((hue - 1024), 1536) - 768) - 256 |
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
#encoding: utf-8 | |
require 'twitter' | |
require 'nokogiri' | |
require 'open-uri' | |
def tweet(client, str) # 文字列を140字以下に分割しつつ呟く | |
if str.size <= 0 then | |
return | |
elsif str.size <= 140 then |
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
#!/usr/bin/env python | |
#coding: utf8 | |
userid="XXXXXXXX@XXXXXXXX" | |
passwd="YYYYYYYY" | |
mid=ZZZZZZZZ | |
import sys, re, cgi, urllib, urllib2, cookielib, xml.dom.minidom, time, json | |
def getToken(): | |
html = urllib2.urlopen("http://www.nicovideo.jp/my/mylist").read() | |
for line in html.splitlines(): |