Skip to content

Instantly share code, notes, and snippets.

@ore-public
ore-public / Gemfile
Last active December 18, 2020 11:05
体重をMackerelのサービスメトリクスに送るスクリプト
# frozen_string_literal: true
source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
gem 'mackerel-client'
@ore-public
ore-public / config.py
Created September 13, 2018 00:23
xkeysnail config
# -*- coding: utf-8 -*-
import re
from xkeysnail.transform import *
# [Global modemap] Change modifier keys as in xmodmap
define_modmap({
Key.CAPSLOCK: Key.LEFT_CTRL
})
@ore-public
ore-public / custom.cnf
Created March 10, 2017 23:10
MySQL Docker Compose
[mysqld]
character-set-server=utf8
pg94:
restart: always
image: postgres:9.4.9
ports:
- "5432:5432"
environment:
- POSTGRES_USER=xxxxx
volumes:
- /Users/xxxxx/docker-dev/pg94/data:/var/lib/postgresql/data
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
@ore-public
ore-public / check.html
Last active May 19, 2016 08:12
checkboxをcssで、パネルのオン・オフみたいにする
<html>
<head>
<title>test</title>
</head>
<style>
input[type=checkbox] {
display: none;
}
label {
display: inline-block;
@ore-public
ore-public / gist:8d75517d56e684fc0e2a
Last active August 29, 2015 14:22
method_missingの挙動
class Hoge
def mmtest
hoge #method_missing が呼ばれる => :hoge
hoge = 10 #mmtestメソッド内のローカル変数が定義される
self.hoge=10 #method_missing が呼ばれる => :hoge=
end
def method_missing(method_name, *args)
p method_name
#include<stdio.h>
#include<stdlib.h>
#define MAX_N 10000000
void set_bit(char *sort_bit, int value, int bit);
int get_bit(char *sort_bit, int value);
int main(void) {
FILE *fp;
syntax on
set nocompatible
filetype off
"""" neobundle.vimの設定
if has('vim_starting')
set runtimepath+=~/.vim/bundle/neobundle.vim/
endif
call neobundle#rc(expand('~/.vim/bundle'))
NeoBundleFetch 'Shougo/neobundle.vim'
@ore-public
ore-public / Rakefile
Created February 13, 2014 16:06
sinatra + ActiveRecord rake task db:xxx の場合のみdatabase.ymlを読みに行くように設定する
task :before_db do
require './db_initialize'
end
namespace :db do |ns|
ns.tasks.each do |db_task|
db_task.enhance([:before_db])
end
end