Skip to content

Instantly share code, notes, and snippets.

@climu
climu / dumpdata
Last active February 7, 2023 19:24
Dumping OSR data
./manage.py dumpdata --natural-foreign --natural-primary -a -o initial-data.json
@climu
climu / app.js
Created November 23, 2019 12:00
failing to use board app into shudan
import { h, Component } from 'preact';
import {Goban} from '@sabaki/shudan';
const Board = require('@sabaki/go-board');
import style from '@sabaki/shudan/css/goban.css';
const signMap = [
[ 0, 0, 0,-1,-1,-1, 1, 0, 1, 1,-1,-1, 0,-1, 0,-1,-1, 1, 0],
[ 0, 0,-1, 0,-1, 1, 1, 1, 0, 1,-1, 0,-1,-1,-1,-1, 1, 1, 0],
{
"gameType": "ranked",
"komi": 6.5,
"size": 19,
"saved": true,
"handicap": 0,
"players": {
"white": {
"name": "chuck1951",
"flags": "cp=",
{
'games': [{
'gameType': 'challenge',
'initialProposal': {
'gameType': 'free',
'players': [
{'role': 'white', 'user': {'name': 'jkkl', 'flags': 'gc', 'rank': '?'}},
{'role': 'black'}
],
'nigiri': True,
climu@openstudyroom:~$ journalctl -xeu osr-bot
Hint: You are currently not seeing messages from other users and the system.
Users in groups 'adm', 'systemd-journal' can see all messages.
Pass -q to turn off this notice.
Oct 03 22:31:54 openstudyroom.org python[11344]: File "/home/climu/osr_bot/venv/lib/python3.5/site-packages/websockets/protocol.py", line 591, in read_data_frame
Oct 03 22:31:54 openstudyroom.org python[11344]: frame = yield from self.read_frame(max_size)
Oct 03 22:31:54 openstudyroom.org python[11344]: File "/home/climu/osr_bot/venv/lib/python3.5/site-packages/websockets/protocol.py", line 632, in read_frame
Oct 03 22:31:54 openstudyroom.org python[11344]: extensions=self.extensions,
Oct 03 22:31:54 openstudyroom.org python[11344]: File "/home/climu/osr_bot/venv/lib/python3.5/site-packages/websockets/framing.py", line 100, in read
Oct 03 22:31:54 openstudyroom.org python[11344]: data = yield from reader(2)
(venv) climu@titbet ~/osr/openstudyroom $ python -Wa manage.py
/home/climu/osr/venv/lib/python3.5/site-packages/wagtail/wagtailcore/models.py:17: RemovedInDjango20Warning: Importing from django.core.urlresolvers is deprecated in favor of django.urls.
from django.core.urlresolvers import reverse
/home/climu/osr/venv/lib/python3.5/site-packages/wagtailmenus/models/menuitems.py:173: RemovedInDjango20Warning: on_delete will be a required arg for ParentalKey in Django 2.0. Set it to models.CASCADE on models and in existing migrations if you want to maintain the current default behavior. See https://docs.djangoproject.com/en/1.11/ref/models/fields/#django.db.models.ForeignKey.on_delete
menu = ParentalKey('wagtailmenus.MainMenu', related_name="menu_items")
/home/climu/osr/venv/lib/python3.5/site-packages/wagtailmenus/models/menuitems.py:178: RemovedInDjango20Warning: on_delete will be a required arg for ParentalKey in Django 2.0. Set it to models.CASCADE on models and in existing migrations if you want to mainta
```(venv) climu@belbet:~/osr/bot/OSR-discord-bot$ python bot.py
Traceback (most recent call last):
File "bot.py", line 2, in <module>
import discord
File "/home/climu/osr/bot/venv/lib/python3.6/site-packages/discord/__init__.py", line 20, in <module>
from .client import Client, AppInfo
File "/home/climu/osr/bot/venv/lib/python3.6/site-packages/discord/client.py", line 30, in <module>
from .guild import Guild
File "/home/climu/osr/bot/venv/lib/python3.6/site-packages/discord/guild.py", line 39, in <module>
from .channel import *
Jul 04 13:41:49 openstudyroom.org python[10919]: UnboundLocalError: local variable 'servers' referenced before assignment
Jul 04 13:41:49 openstudyroom.org python[10919]: The above exception was the direct cause of the following exception:
Jul 04 13:41:49 openstudyroom.org python[10919]: Traceback (most recent call last):
Jul 04 13:41:49 openstudyroom.org python[10919]: File "/home/climu/osr_bot/venv/lib/python3.5/site-packages/discord/ext/commands/bot.py", line 8
Jul 04 13:41:49 openstudyroom.org python[10919]: yield from ctx.command.invoke(ctx)
Jul 04 13:41:49 openstudyroom.org python[10919]: File "/home/climu/osr_bot/venv/lib/python3.5/site-packages/discord/ext/commands/core.py", line
Jul 04 13:41:49 openstudyroom.org python[10919]: yield from injected(*ctx.args, **ctx.kwargs)
Jul 04 13:41:49 openstudyroom.org python[10919]: File "/home/climu/osr_bot/venv/lib/python3.5/site-packages/discord/ext/commands/core.py", line
Jul 04 13:41:49 openstudyroom.org python[10919]: raise CommandInvokeE
var match_8_sortable = Sortable.create(match_8,{
group: {
name: 'players_list',
pull: function (to, from){
to = $(to.el)
if ($(from.el).hasClass('played')){
return 'clone';
}
if ((to.attr('data-round') <= 4) && (to.attr('data-bracket') == 2)){
return true;
@climu
climu / keybase.md
Created May 8, 2018 22:41
keybase.md

Keybase proof

I hereby claim:

  • I am climu on github.
  • I am climu (https://keybase.io/climu) on keybase.
  • I have a public key whose fingerprint is E275 BB11 3F5D E78D 7098 AE7A E8CF F6F8 ADAA 632A

To claim this, I am signing this object: