Skip to content

Instantly share code, notes, and snippets.

View iberianpig's full-sized avatar

Kohei Yamada iberianpig

View GitHub Profile
@shouhei
shouhei / sample.py
Last active September 26, 2019 08:19
SQLAlchemy Python3 MySQL Geometroy
# Geometory型の設定
from sqlalchemy import func
from sqlalchemy.types import UserDefinedType
class Geometory(UserDefinedType):
def get_col_spec(self):
# カラムの型
return "GEOMETRY"
def bind_expression(self, bindvalue):
@sonots
sonots / GC.stat.md
Last active October 27, 2015 00:57

2.1

{:count=>24, # GC全体回数(major + minor)
 :heap_used=>261,
 :heap_length=>261, # ヒープに現在あるページ数
 :heap_increment=>27,
 :heap_live_slot=>94990, # 生きているオブジェクト(スロット)の数 total_allocated_object - total_freed_object
 :heap_free_slot=>11400, # すべてのページを通じて空いているスロットの数 (どのページがどのぐらい空いているとかはわからない)
 :heap_final_slot=>0,
@joker1007
joker1007 / ginzarb_21.md
Last active September 5, 2025 05:31
Ginza.rb 21回の発表資料。rails_adminのつらみとオススメgem達。

rails_adminのつらみとオススメGemについて

rails_adminのつらみ

カスタマイズできるようで出来ない

レコード件数が一定以上になると使えない機能

  • ダッシュボード
  • 何も考えずに各モデルをカウントするのでレコード件数増えるとえらいことになる。
@keijiro
keijiro / XPS13-Ubuntu.md
Last active May 22, 2019 04:00
Dell XPS 13 (2015) に Ubuntu を入れる

2015/4/24 追記 - Ubuntu 15.04 (Vivid Vervet) では特に工夫しなくともすんなり動作するようになった模様です。ということで、インストール時には 15.04 を選ぶようにしましょう。

下記は 14.04 向けの古い情報となります。


XPS 13

Dell の XPS 13 (2015) に Ubuntu を入れたら幸せになれるのではないか。そんな気がしたので入れてみたのですが、案外に気をつけるべきポイントが多いので、手順を書き記しておきます。

@dreki
dreki / scss-rules-for-ctags
Created October 16, 2014 14:05
SCSS rules for ctags
--langdef=scss
--langmap=scss:.scss
--regex-scss=/^[ \t]*\.([A-Za-z0-9_-]+)/.\1/c,class,classes/
--regex-scss=/^[ \t]*#([A-Za-z0-9_-]+)/#\1/i,id,ids/
--regex-scss=/^[ \t]*(([A-Za-z0-9_-]+[ \t\n,]+)+)\{/\1/t,tag,tags/
--regex-scss=/^[ \t]*@media\s+([A-Za-z0-9_-]+)/\1/m,media,medias/
--regex-scss=/^[ \t]*\$([A-Za-z0-9_-]+)/\$\1/v,var,variables/
@EdEichman-LentillasSi
EdEichman-LentillasSi / zopim_defer.js
Last active March 30, 2025 19:50
Defer Loading Zopim until page is loaded (to avoid long load delay), based on article http://www.feedthebot.com/pagespeed/defer-loading-javascript.html
//basic zopim widget code, from their site
window.$zopim||(function(d,s){var z=$zopim=function(c){z._.push(c)},$=z.s=
d.createElement(s),e=d.getElementsByTagName(s)[0];z.set=function(o){z.set.
_.push(o)};z._=[];z.set._=[];$.async=!0;$.setAttribute('charset','utf-8');
$.src='//v2.zopim.com/?26Smu9lv0NXQEOOg8IAZrMPh9yQstAcV';z.t=+new Date;$.
type='text/javascript';e.parentNode.insertBefore($,e)})(document,'script');
//make sure zopim does not show till we know we have department agents
var intial_zopim_hiding_done = false;
@k2wanko
k2wanko / prepare-commit-msg
Last active October 27, 2015 23:41
prepare-commit-msg
#!/bin/sh
# https://gist.github.com/k2wanko/2217a7615b776a29d544
branch=$(git branch | grep "*" | awk '{print $2}')
# if match , it return number only. if no match, it return branch name.
parse() {
target=$(cat -)
res=$(echo $target | sed -E -e "s/.*((#|issue[s]?[\/-_]?|_|-)([0-9]*)).*/\3/g")
if [ -n "$res" ]; then
@wkjagt
wkjagt / audio-book-reader.md
Last active September 3, 2025 19:58
How I built an audio book reader for my nearly blind grandfather

#How I built an audio book reader for my nearly blind grandfather

Tweet this - Follow me

Last year, when visiting my family back home in Holland, I also stopped by my grand-parents. My grand-father, now 93 years old, had always been a very active man. However, during the presceding couple of months, he'd gone almost completely blind and now spent his days sitting in a chair. Trying to think of something for him to do, I suggested he try out audio books. After finally convincing him -- he said audio books were for sad old people -- that listening to a well performed recording is actually a wonderful experience, I realized the problem of this idea.

####The problem with audio devices and the newly blind. After my first impulse to jump up and go buy him an

@tmd45
tmd45 / Gemfile
Last active August 29, 2015 14:02
nippo.rb; refs. Githubで今日なにをしたか、調べるスクリプトを書いた - きたけーTechブログ http://kitak.hatenablog.jp/entry/2014/04/22/013849
source 'https://rubygems.org'
ruby '2.1.5'
gem 'i18n'
gem 'activesupport'
gem 'octokit'