Skip to content

Instantly share code, notes, and snippets.

View yassu's full-sized avatar
💭
👨‍💼

yassu yassu

💭
👨‍💼
  • JP
View GitHub Profile
@yassu
yassu / fish-pyenv-error
Created February 18, 2017 08:21
error about fish for pyenv
Last login: Sat Feb 18 17:18:54 on ttys003
~/.config/fish/config.fish (line 1): pyenv init -|psub
^
in command substitution
called on line -1 of file ~/.config/fish/config.fish
from sourcing file ~/.config/fish/config.fish
called during startup
@yassu
yassu / tasks.py
Created February 16, 2017 13:36
simple file for tex project by pyinvoke
from invoke import task
AUTHOR = 'yassu'
MAIN_BASENAME = 'main'
LATEX = 'platex'
DVIP = 'dvipdfmx'
VIEW_PDF = 'evince'
@task
fn sgn(x: f32) -> f32 {
x/x.abs()
}
fn get_y(x: f32) -> f32 {
1.0/(1.0 + sgn(x)) + 1.0/(1.0-sgn(x))
}
@yassu
yassu / vimrc
Created December 11, 2016 06:59
my vimrc
scriptencoding utf-8
set encoding=utf-8
set fileencodings=utf-8,euc-jp,iso-2022-jp,sjis
set runtimepath+=~/.vim/dein/repos/github.com/Shougo/dein.vim
call dein#begin(expand('~/.vim/dein/'))
call dein#add('thinca/vim-quickrun')
autocmd BufRead,BufNewFile *_test.py set filetype=python.test
let g:quickrun_config = {}
N = 100
def is_divisable(n, k):
return n % k == 0
def get_number_of_divisable_numbers(n):
number = 0
for k in range(1, n + 1):
if is_divisable(n, k):
@yassu
yassu / vim-git-pull-hist
Created September 13, 2016 14:35
history of pulling vim of git
remote: Counting objects: 1956, done.
remote: Compressing objects: 100% (57/57), done.
remote: Total 1956 (delta 1670), reused 1631 (delta 1631), pack-reused 268
Receiving objects: 100% (1956/1956), 2.33 MiB | 67.00 KiB/s, done.
Resolving deltas: 100% (1792/1792), completed with 847 local objects.
From https://github.com/vim/vim
1195669..789a5c0 master -> origin/master
* [new tag] v8.0.0003 -> v8.0.0003
* [new tag] v7.4.2269 -> v7.4.2269
* [new tag] v7.4.2270 -> v7.4.2270
@yassu
yassu / interface.go
Created June 12, 2016 08:37
sample of interface for golang
package main
import (
"fmt"
)
type Animal interface {
Cow() string
}
@yassu
yassu / free_group.py
Created March 20, 2016 05:07
class for free groups
#!/usr/bin/env python
# coding: UTF-8
class Character(str):
pass
ONE = (Character('1'), 0)
class Word(list):
# list of pair of Character and power
基本:
tmux ls: セッションの確認
<pre>d: セッションのデタッチ
tmux attach: 直近のセッションにアタッチ
tmux kill-session: セッションの削除
<pre>$: セッションのリネーム
windowの操作:
<pre>c: 新規window
<pre>{win-num}: windowの移動
@yassu
yassu / main.js
Created January 29, 2016 18:09
with bugs
enchant();
var CELL_LENGTH = 32;
window.onload = function() {
var core = new Core(350, 320);
core.fps = 30;
core.preload("chara1.png");
core.preload("map0.png");