Skip to content

Instantly share code, notes, and snippets.

kenkoooo kenkoooo

Block or report user

Report or block kenkoooo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Profile Rust on Linux.md

Profiling performance

Using perf:

$ perf record -g binary
$ perf script | stackcollapse-perf.pl | rust-unmangle | flamegraph.pl > flame.svg

NOTE: See @GabrielMajeri's comments below about the -g option.

View exectuion_result.txt
$ time python test.py
real 0m0.148s
user 0m0.133s
sys 0m0.019s
View .bashrc
SESSION_NAME=ope
if [[ -z "$TMUX" && -z "$STY" ]] && type tmux >/dev/null 2>&1; then
option=""
if tmux has-session -t ${SESSION_NAME}; then
option="attach -t ${SESSION_NAME}"
else
option="new -s ${SESSION_NAME}"
fi
tmux $option && exit
View FibHeap.py
import heapq
import random
class FibNode:
def __init__(self, key):
self.degree = 0
self.parent = None
self.children = []
self.key = key
View hoge.html
<html>
<head>
<meta name="twitter:card" content="summary" />
<meta property="og:title" content="A Twitter for My Sister" />
<meta property="og:description" content="" />
<meta property="og:image" content="http://graphics8.nytimes.com/images/2011/12/08/technology/bits-newtwitter/bits-newtwitter-tmagArticle.jpg" />
</head>
<body></body>
</html>
View .zshrc.sh
# 環境変数
export LANG=ja_JP.UTF-8
# 色を使用出来るようにする
autoload -Uz colors
colors
# ヒストリの設定
HISTFILE=~/.zsh_history
HISTSIZE=1000000
@kenkoooo
kenkoooo / PokeVisioner.py
Last active Jul 30, 2016
ハッカソンの素材
View PokeVisioner.py
import json
import time
import urllib.request
def download_json(url):
user_agent = "Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A403 Safari/8536.25"
headers = {'User-Agent': user_agent}
req = urllib.request.Request(url, None, headers)
with urllib.request.urlopen(req) as response:
@kenkoooo
kenkoooo / Takezo.java
Created Jul 2, 2016
某氏の Ruby スクリプトを撃墜するためのランダムケースジェネレーター
View Takezo.java
import java.io.*;
import java.util.ArrayList;
import java.util.Random;
public class Takezo {
public static void main(String[] args) throws IOException {
Random random = new Random();
File dir = new File("/Users/um003282/Desktop");
while (true) {
View JSON上書き.py
#!/usr/bin/env python
# coding: UTF-8
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import statsmodels.api as sm
import seaborn as sns
import json
import sys
You can’t perform that action at this time.