Skip to content

Instantly share code, notes, and snippets.

View Bakudankun's full-sized avatar
💣
Lit

バクダンくん Bakudankun

💣
Lit
View GitHub Profile
@Bakudankun
Bakudankun / vocalonobis2mylist.py
Last active December 21, 2015 17:36
VOCALONOBISのランキングを取得してニコニコ動画のマイリストに並べるスクリプト
#!/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():
@Bakudankun
Bakudankun / bandbrospnews.rb
Last active August 29, 2015 14:10
「大合奏!バンドブラザーズP」の日刊バンブラ通信をTwitterにつぶやくbot
#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
@Bakudankun
Bakudankun / partycursor.vim
Last active April 1, 2022 14:00
PARTY OR DIE - Activate by ` :so https://git.io/JO5NW `
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
@Bakudankun
Bakudankun / dice.vim
Last active January 16, 2023 12:41
:3D6 みたいに使えるサイコロ
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>)
@Bakudankun
Bakudankun / infs.vim
Last active March 16, 2023 12:47
Incremental fuzzy search for Vim/Neovim
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
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]},