Skip to content

Instantly share code, notes, and snippets.

View hachibeeDI's full-sized avatar

OGURA Daiki hachibeeDI

View GitHub Profile
@hachibeeDI
hachibeeDI / flexsidebar.html
Created December 17, 2013 11:06
サイドバーをよしなにするやつ。 li要素を消したりしてみてくれやす
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>aaaa</title>
<link rel="stylesheet" href="./main.css" type="text/css" media="screen" charset="utf-8">
</head>
<body>
<div id="container">
<div id="header">header</div>
@hachibeeDI
hachibeeDI / file0.js
Created January 7, 2014 10:51
押すと上にスルスルっと戻るJavaScriptモジュール ref: http://qiita.com/hatchinee/items/9e1ad803c4c57069ee39
var ns = (function(exports) {
var Raise = function constructor() {
this._init_handler = function(func) {
window.addEventListener('load', func);
};
};
Raise.prototype.register = function(id) {
var to_top = function(e) {
var scroll_top = document.documentElement.scrollTop || document.body.scrollTop;
@hachibeeDI
hachibeeDI / measure_heap.py
Created January 8, 2014 08:53
guppyでのヒープ測定をwithとかデコレータで出来るようにするスニペット
# -*- coding: utf-8 -*-
from __future__ import print_function
from guppy import hpy
class measure_heap(object):
'''
メモリ消費量を測定する。
@hachibeeDI
hachibeeDI / widget.styl
Created January 21, 2014 05:44
stylus mix-in for widgets
// require: npm install nib
@import 'nib/vendor'
support-for-ie = false // disable old browser support
topstand-triangle()
width: 0
height: 0
border-top: 25px solid bg-color
border-left: 20px solid transparent
@hachibeeDI
hachibeeDI / find_leftover_po.py
Last active August 29, 2015 13:55
require -> `pip install polib`
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (print_function, division, absolute_import, unicode_literals, )
import polib
from polib import POEntry
def __eq__(self, other):
@hachibeeDI
hachibeeDI / git-hub-pubkeys
Created March 31, 2014 09:01
sshの公開鍵をさくっと取得するスクリプト ref: http://qiita.com/hatchinee/items/7174b2a23788a23a6082
#/bin/sh -u
set -e
readonly DEFAULT_USER='hachibeeDI'
if [ $# -ge 2 ]; then
echo 'too much arguments'
exit 1
fi
*.pyc
bin/
include/
lib/
# -*- coding: utf-8 -*-
from __future__ import (print_function, division, absolute_import, unicode_literals, )
def _snake_to_camel(text):
letters = list(text)
def _conv(l1, l2):
if l1[-1] == '_':
return l1.replace('_', '') + l2.upper()
papers = [80, 10, 20, 30, 71, 69, 100]
result = papers.reduce(
{passing: [], rejected: [], }
) do |boxes, paper|
if paper >= 70 then boxes[:passing] else boxes[:rejected] end << (paper)
boxes
end
p result
# => {:passing=>[80, 71, 100], :rejected=>[10, 20, 30, 69]}
/* Responsive: yes */
/* <system section="theme" selected="bordeaux"> */
@import "/css/theme/bordeaux/bordeaux.css";
/* </system> */
/* elements {{{ */
/* <system section="background" selected="490A3D"> */
body{
background-color: #2dadac;
color: #fff6d3;