Skip to content

Instantly share code, notes, and snippets.

サワードウ・スターター(天然酵母)づくり編

用意するもの

  • ライ麦全粒粉もしくは小麦粉全粒粉
    • ライ麦なら酸味が強め、小麦粉なら弱めになる
  • 口の広いガラス瓶

つくりかた

@mirakui
mirakui / jpeg_markers.rb
Created September 17, 2012 02:53
Extract width and height from JPEG format
module JpegMarkers
MARKERS = Hash[*%W(
SOF0 \xff\xc0
SOF1 \xff\xc1
SOF2 \xff\xc2
SOF3 \xff\xc3
DHT \xff\xc4
SOF5 \xff\xc5
SOF6 \xff\xc6
SOF7 \xff\xc7
FROM node:10-slim
WORKDIR /usr/src/app
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
&& apt-get update \
&& apt-get install -y google-chrome-unstable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst ttf-freefont \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
@mirakui
mirakui / awsconsoleactivator.user.js
Created September 27, 2010 02:55
AWS Console Activator
// ==UserScript==
// @name AWS Console Activator
// @description AWS Console Activator
// @match https://console.aws.amazon.com/*
// ==/UserScript==
(function() {
var interval = 1000*60;
setInterval(function() {$("#refresh_btn-button").click()}, interval);
})();
@mirakui
mirakui / Gemfile
Created July 19, 2010 09:44
AWS S3 read/write Benchmark
source :gemcutter
gem 'pit'
gem 'sauberia-aws-s3'
@mirakui
mirakui / readonly_console.rb
Created May 1, 2012 02:08
readonly rails console using Arproxy
#!/usr/bin/env ruby
APP_PATH = File.expand_path('../../config/application', __FILE__)
require File.expand_path('../../config/boot', __FILE__)
require 'rails/commands/console'
require APP_PATH
Rails.application.require_environment!
require "arproxy"
module Arproxy
class Readonly < Base
@mirakui
mirakui / make_token.rb
Created May 3, 2010 13:05
To get twitter/oauth access token
require 'twitter_oauth'
print 'Consumer Key> '
consumer_key = gets.chomp
print 'Consumer Secret> '
consumer_secret = gets.chomp
t = TwitterOAuth::Client.new(
:consumer_key => consumer_key,

入出力

標準入力を隠す

require 'io/console'
password = STDIN.noecho(&:gets).chomp

日付・時刻

Time.now.strftime("%Y/%m/%d %H:%M:%S")
@mirakui
mirakui / README.md
Last active December 20, 2015 11:08
fake-s3 + aws-sdk
$ gem install aws-sdk fake-s3
$ fakes3 -r /tmp/fakes3 -p 4567
Loading FakeS3 with /tmp/fakes3 on port 4567 with hostname s3.amazonaws.com
[2013-07-31 17:52:34] INFO  WEBrick 1.3.1
[2013-07-31 17:52:34] INFO  ruby 2.0.0 (2013-06-27) [x86_64-darwin12.4.0]
[2013-07-31 17:52:34] INFO  WEBrick::HTTPServer#start: pid=34539 port=4567

Using rails_admin without devise

Having a buckload of code to authorize users on your application is something you may like or not. Speaking for myself I hate it. But I still love rails_admin, here's how you install it without devise. Thanks to phoet for providing the hints in the gist I have forked from.

Add RailsAdmin to your Gemfile

do NOT add devise

gem "rails_admin", :git => "git://github.com/sferik/rails_admin.git"