Skip to content

Instantly share code, notes, and snippets.

View mh-mobile's full-sized avatar
🏠
Working from home

mh-mobile mh-mobile

🏠
Working from home
View GitHub Profile
@mh-mobile
mh-mobile / pink.css
Last active May 11, 2019 11:40
change background-color to pink
body {
background-color: pink;
}
@mh-mobile
mh-mobile / gist:58fefc723fc1bce5b97ce9a75c7a2030
Created October 20, 2019 03:46
SharedPreferencesで文字列配列の取得・設定例
getMessages() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
List<String> messages = await prefs.getStringList("messages") ?? List<String>();
setState(() {
_messages = messages.map((message) {
return Message(message: message,);
}).toList() ;
});
}
@mh-mobile
mh-mobile / gist:775a763d55f4cb63a2f82a339bec1f7c
Last active October 28, 2019 11:59 — forked from machida/html_practice.html
HTMLの練習(このレシピにマークアップをしてみましょう)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>カレーのレシピ</title>
</head>
<body>
<article>
@mh-mobile
mh-mobile / has_one_polymorphic_association.rb
Last active April 19, 2020 14:37
has _one :through polymorphic association
# frozen_string_literal: true
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
# Activate the gem you are reporting the issue against.
@mh-mobile
mh-mobile / has_one_polymorphic_association.rb
Last active April 19, 2020 14:38
ActiveRecord::HasOneAssociationPolymorphicThroughError:
# frozen_string_literal: true
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
# Activate the gem you are reporting the issue against.
@mh-mobile
mh-mobile / friendship.rb
Last active April 21, 2020 10:48
follow relationship
# frozen_string_literal: true
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
# Activate the gem you are reporting the issue against.
@mh-mobile
mh-mobile / comment_association_test.rb
Last active October 25, 2020 04:29
コメントの関連付けテスト
# frozen_string_literal: true
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
# Activate the gem you are reporting the issue against.
#!/usr/bin/env node
console.log("run gist!")
@mh-mobile
mh-mobile / array-apply.js
Last active May 4, 2020 13:15
JavaScript Iterate
#!/usr/bin/env node
Array.apply(null, { length: 10 }).forEach((_, i) => {
console.log(i);
});
require("yargs")
.scriptName("console")
.usage("$0 <cmd> [args]")
.command(
"hello [name]",
"console your name!",
(yargs) => {
yargs.positional("name", {
type: "string",
default: "mh-mobile",