Skip to content

Instantly share code, notes, and snippets.

@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;
# -*- coding: utf-8 -*-
from __future__ import (print_function, division, absolute_import, unicode_literals, )
class Monad(object):
def __init__(self, v):
self.value = v
def __repr__(self):
@hachibeeDI
hachibeeDI / perhaps.py
Created May 20, 2014 05:58
Object#try in python
# -*- coding: utf-8 -*-
from __future__ import (print_function, division, absolute_import, unicode_literals, )
from operator import methodcaller
class Perhaps(object):
'''
>>> p = Perhaps('hoge huga foo')
>>> P = p.try_('replace', 'huga', 'muoo').try_('upper').apply(print)
# found this from Armin R. on Twitter, what a beautiful gem ;)
import ctypes
from types import DictProxyType, MethodType
# figure out side of _Py_ssize_t
if hasattr(ctypes.pythonapi, 'Py_InitModule4_64'):
_Py_ssize_t = ctypes.c_int64
else:
_Py_ssize_t = ctypes.c_int

Question

How to implement a UITableView with a separator line like this:

doubly separator line

Usually, you can only set the separatorLine property of a UITableView with to single line or single line etched. Sometimes, it is not enough. So, how to implement a separator line like this?

Answer