Skip to content

Instantly share code, notes, and snippets.

View masoo's full-sized avatar
🐔
In the chicken

FUNABARA Masao masoo

🐔
In the chicken
View GitHub Profile
@mattn
mattn / README.md
Last active March 19, 2020 12:08
gvim で使える等幅フォント
require 'mail'
Mail.defaults do
options = { :address => "smtp.gmail.com",
:port => 587,
:user_name => 'kosaki.motohiro',
:password => 'パスワード',
:authentication => 'plain',
:enable_starttls_auto => true }
@aq2bq
aq2bq / seeds.rb
Last active July 28, 2016 01:42
[JPローカライズ]Spree 2.1.1 with Rails4 用シードファイル
# encoding: utf-8
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
# Mayor.create(name: 'Emanuel', city: cities.first)
@aq2bq
aq2bq / seeds.rb
Last active July 28, 2016 01:41
[JPローカライズ] Spree 2.0.x 向け seeds.rb (Spree 2.1.1 with Rails4 用は https://gist.github.com/aq2bq/6790523 )
# encoding: utf-8
Rails.application.config.active_record.whitelist_attributes = false
ActiveRecord::Base.class_eval do
class << self
def create_or_update! attrs={}
instance = first_or_initialize(attrs, :without_protection => true)
instance.save!
end
@korny
korny / jquery_ujs.prompt.js.coffee
Last active May 29, 2024 08:02
Simple prompt functionality for Rails / jQuery UJS, modelled after "confirm". Tested with Rails 4 (edge).
# Usage: link_to …, prompt: { message: 'Some message', default: 'default value', param: 'name of parameter' }
# The prompt will ask for "message" and use "default" as the default value.
# Unless user selects cancel, "param"=<new value> will be sent to the given path.
# Optionally, you can just use `prompt: "message"`.
$.rails.prompt = (message, defaultValue) ->
window.prompt message, defaultValue
$.rails.handlePrompt = (element) ->
config = element.data 'prompt'
@pathawks
pathawks / meta.html
Last active May 20, 2020 19:27
Open Graph for Jekyll
{% if include.content %}
<meta property="{{ include.property }}" content="{{ include.content }}" />
{% endif %}
@taizooo
taizooo / hoge.markdown
Created December 22, 2009 02:46
gist で markdown 記法がつかえる。

#なんだかんだ

##えーと1 どういうこういう そういうどういう

##えーと2 どういうこういう そういうどういう