Skip to content

Instantly share code, notes, and snippets.

View regonn's full-sized avatar
🍵
Tea.

regonn regonn

🍵
Tea.
View GitHub Profile
<figure>
<img src="/img/photo.jpg">
<figcaption>Lorem ipsum dolor sit amet</figcaption>
</figure>
figure {
display: table;
width: 160px; /* minimum width */
*width: auto; /* for IE7 and below */
}
@regonn
regonn / evernote.gs
Last active February 26, 2024 10:00
function sendToEvernote() {
var evernote_email = "xxxxxxxxx@m.evernote.com";
var note_title = "お問い合わせ @ギルド問い合わせ" //「AAAAAA @BBBBBB」"@BBBBBB"で指定したノートに"AAAAA"というタイトルで追加されます
var range = SpreadsheetApp.getActiveRange(); //変更されたセルを取得
var col = range.getColumnIndex(); //変更のあったセルの列を取得
var row = range.getRowIndex(); //変更のあったセルの行を取得
if(col == 7){
reply = range.getValue(); //変更されたステータスの値
var sheet = SpreadsheetApp.getActiveSheet();
@regonn
regonn / sample.jade
Created October 10, 2013 03:01
外注したコードに残っていた謎のコード
- var height = 300
- if (i % 3 == 1)
- height = 400
- if (i % 3 == 2)
- height = 500
- height = 300
@regonn
regonn / route.rb
Created November 6, 2013 05:50
config/routes.rb
Sample::Application.routes.draw do
resources :items
end
@regonn
regonn / routing
Created November 6, 2013 06:00
rake routesでrouting確認
Prefix Verb URI Pattern Controller#Action
items GET /items(.:format) items#index
POST /items(.:format) items#create
new_item GET /items/new(.:format) items#new
edit_item GET /items/:id/edit(.:format) items#edit
item GET /items/:id(.:format) items#show
PATCH /items/:id(.:format) items#update
PUT /items/:id(.:format) items#update
DELETE /items/:id(.:format) items#destroy
class ItemsController < ApplicationController
before_action :set_item, only: [:show, :edit, :update, :destroy]
def index
@items = Item.all
end
def show
end
class CreateItems < ActiveRecord::Migration
def change
create_table :items do |t|
t.string :name
t.integer :price
t.text :description
t.timestamps
end
end
<h1>Listing items</h1>
<table>
<thead>
<tr>
<th>Name</th>
<th>Price</th>
<th>Description</th>
<th></th>
<th></th>
json.array!(@items) do |item|
json.extract! item, :name, :price, :description
json.url item_url(item, format: :json)
end