Skip to content

Instantly share code, notes, and snippets.

View gentamura's full-sized avatar
👋
hi

Gen Tamura gentamura

👋
hi
View GitHub Profile
@gentamura
gentamura / Typography.tsx
Last active November 26, 2021 02:46
Font Family checks on several OS by Next.js
const createFontDebugComponent = (Component) => (
Array<number>(9)
.fill(0)
.map<number>((_, i) => i + 1)
.map<number>((size) => {
const weight = size * 100;
return (
<Component size={size} weight={weight} />
);
@gentamura
gentamura / html_practice.html
Last active May 8, 2021 07:35 — forked from machida/html_practice.html
HTMLの練習(このレシピにマークアップをしてみましょう)
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>カレーのレシピ</title>
</head>
<body>
<main>
<h1>カレーのレシピ</h1>
<p>
{
"public": true,
"builds": [
{
"src": "vercel_basic_auth.js",
"use": "@vercel/node"
}
],
"routes": [
{
@gentamura
gentamura / duplicate_data.json
Created December 22, 2016 03:29
重複したkeyを持つJSONデータをカンマ区切りvalueにまとめる ref: http://qiita.com/GenTamura84/items/623bb5d5c5a4bfe58678
{
"foo": "ふー",
"bar": "ばー",
"baz": "ばず",
"foo": "フー",
"bar": "バー",
"baz": "バズ"
}
@gentamura
gentamura / setup.sh
Last active December 15, 2017 00:46
#!/bin/sh
# Ubuntu setup from vagrant
###### via https://gorails.com/setup/ubuntu/14.04
echo "Packages setting..."
sudo apt-get -y update
sudo apt-get -y install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev
## Ruby
echo "Ruby setting..."
cd
@gentamura
gentamura / file1.txt
Created June 19, 2015 04:35
Created via API
Demo
@gentamura
gentamura / _form.html.erb
Created December 6, 2014 03:10
Cloudinary + Carrierwave + Heroku + Railsでの画像を手軽に利用する方法 ref: http://qiita.com/GenTamura84/items/38cf899827bba050a21c
<%= form_for(@user) do |f| %>
<% if @user.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2>
<ul>
<% @user.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
@gentamura
gentamura / Gemfile
Created July 1, 2013 09:05
Rails + Compass でCSSの開発を高速化! ref: http://qiita.com/GenTamura84/items/2b24b93026081ad36bb1
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'compass-rails'
gem 'uglifier', '>= 1.0.3'
end
@gentamura
gentamura / sslrails
Created November 4, 2012 15:08
Railsのローカル環境にhttps(SSL)を導入する方法 ref: http://qiita.com/items/a1af6e9b5eb69d5469b7
#!/usr/bin/env ruby
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
APP_PATH = File.expand_path('../../config/application', __FILE__)
require File.expand_path('../../config/boot', __FILE__)
require 'rubygems'
require 'rails/commands/server'
require 'rack'
require 'webrick'
@gentamura
gentamura / file0.txt
Created November 3, 2012 10:40
Herokuの本番環境にRailsでSSL(https)を導入する方法 ref: http://qiita.com/items/7a12ca611705017bcb0e
$ openssl genrsa -des3 -out server.orig.key 2048
...
Enter pass phrase for server.key: 適当なパスワードを。
Verifying - Enter pass phrase for server.key: もう一度同じパスワードを。