Skip to content

Instantly share code, notes, and snippets.

View kentarofujiy's full-sized avatar
🏠
Working from home

Kentaro Fujiy kentarofujiy

🏠
Working from home
View GitHub Profile
![Alt text](path.ext?raw=true)
<style id="jsbin-css">
#myVideo {
position: absolute;
width: 100%;
}
#myVideo2 {
position: absolute;
width: 100%;
}
#myVideo3 {
@kentarofujiy
kentarofujiy / index.css
Last active January 3, 2019 15:52
getjson
body {
background-color: #F8F8F8;
font-family: 'Open Sans', sans-serif;
font-size: 14px;
font-weight: normal;
line-height: 1.2em;
margin: 15px;
}
h1, p, td, th, label, table {
@kentarofujiy
kentarofujiy / History|28a8d735|wpxC.json
Last active April 10, 2022 19:43
Google Translate Custom Styling
{
"editor.suggestSelection": "first",
"remote.SSH.remotePlatform": {
"165.227.100.91": "linux",
"192.168.15.18": "linux",
"seminovos-kentaro": "linux",
"142.93.108.210": "linux",
"servidor-home": "linux",
"sotreq-novosite-rails": "linux",
"sotreq-novosite-vue": "linux",
# Model
class Profile < ApplicationRecord
has_one_attached :avatar
accepts_nested_attributes_for :avatar_attachment, allow_destroy: true
end
# Controller
class ProfilesController < ApplicationController
before_action :set_profile, only: [:show, :edit, :update, :destroy]
<?php
//set up pods::find parameters to limit to 5 items
$param = array(
'limit' => 5,
);
//create pods object
$pods = pods('pod_name', $params );
//check that total values (given limit) returned is greater than zero
if ( $pods->total() > 0 ) {
@kentarofujiy
kentarofujiy / index.html
Last active November 3, 2019 22:54
owl-pop
<div class="owl-carousel owl-theme">
<div>
<a class="image-popup-vertical-fit" href="https://images.unsplash.com/photo-1567816632324-6c5e972d33e3?ixlib=rb-1.2.1&q=85&fm=jpg&crop=entropy&cs=srgb&ixid=eyJhcHBfaWQiOjE0NTg5fQ" title="This image fits only horizontally.">
<img src="https://images.unsplash.com/photo-1567816632324-6c5e972d33e3?ixlib=rb-1.2.1&q=85&fm=jpg&crop=entropy&cs=srgb&ixid=eyJhcHBfaWQiOjE0NTg5fQ" />
</a>
</div>
<div>
<a class="image-popup-vertical-fit" href="https://images.unsplash.com/photo-1567816632324-6c5e972d33e3?ixlib=rb-1.2.1&q=85&fm=jpg&crop=entropy&cs=srgb&ixid=eyJhcHBfaWQiOjE0NTg5fQ" title="This image fits only horizontally.">
<img src="https://images.unsplash.com/photo-1567816632324-6c5e972d33e3?ixlib=rb-1.2.1&q=85&fm=jpg&crop=entropy&cs=srgb&ixid=eyJhcHBfaWQiOjE0NTg5fQ" />
</a>
default: &default
adapter: postgresql
encoding: unicode
template: template0
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
development:
<<: *default
database: sihusa_development
@kentarofujiy
kentarofujiy / gist:78ff1fb384c3b44f49f8d62c10142011
Created January 6, 2020 19:39 — forked from arjunvenkat/gist:1115bc41bf395a162084
Seeding a Rails database with a CSV file

How to seed a Rails database with a CSV file

1. Setup

First, Create a folder inside of lib called seeds

Put your CSV file example.csv into the lib/seeds folder. In the example below, the file is called real_estate_transactions.csv

Make sure you've created a resource with the appropriate columns to match your seed data. The names don't have to match up.