Skip to content

Instantly share code, notes, and snippets.

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

ichiroc ichiroc

🏠
Working from home
View GitHub Profile
@ichiroc
ichiroc / simple_form_daisyui.rb
Last active January 31, 2024 05:47
simple_form configuration for daisyUI
# frozen_string_literal: true
#
# Uncomment this and change the path if necessary to include your own
# components.
# See https://github.com/heartcombo/simple_form#custom-components to know
# more about custom components.
# Dir[Rails.root.join('lib/components/**/*.rb')].each { |f| require f }
#
# Use this setup block to configure all options available in SimpleForm.
SimpleForm.setup do |config|
post されるかな?
<html>
<!-- https://jp.vuejs.org/v2/guide/ -->
<head>
<script src="https://unpkg.com/vue"></script>
</head>
<body>
<h2>普通のバインド</h2>
<div id="app">
{{ message }}
@ichiroc
ichiroc / index.html
Last active October 20, 2016 22:44
Toggle menu and scroll text.
<html>
<meta charset="UTF-8">
<head>
<script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
<script>
$(function(){
// Toggle menu
var toggleMenu = function(status){
if(status === 1){
$("#sub-menu1").show();
@ichiroc
ichiroc / file0.xml
Created June 9, 2016 11:04
AquaSKK で ; (セミコロン) を Sticky Shift に使う ref: http://qiita.com/ichiroc@github/items/0f6d7b19bd8e9f111b36
<?xml version="1.0"?>
<root>
<list>
<item>
<name>Sticky Shift</name>
<appendix>Use semicolon to Sticky Shift_L</appendix>
<identifier>private.semicolon_to_sticky_shift_l</identifier>
<inputmode_only>JAPANESE</inputmode_only>
<autogen>--KeyToKey-- KeyCode::SEMICOLON, KeyCode::VK_STICKY_SHIFT_L</autogen>
</item>
@ichiroc
ichiroc / file0.rb
Last active May 25, 2016 04:25
iOS の Remote Push Notification 通知実装手順メモ ref: http://qiita.com/ichiroc@github/items/9816db6cd19eb2a186d8
require 'apns'
# sandbox
APNS.pem = "/your/pem/file"
token = "your device token"
APNS.send_notification(token,"message")
/*
*= require fontawesome
*= require_tree .
*= require_self
*/
@ichiroc
ichiroc / file0.swift
Last active February 17, 2016 22:35
storyboard.instantiateViewControllerWithIdentifier から初期化すると IBOutlet が nil になる ref: http://qiita.com/ichiroc@github/items/499e2467e92a543e9c6d
let content = storyboard?.instantiateViewControllerWithIdentifier("Storyboard ID")
if let content0 = content! as? HogeViewController{
let v = content0.view // v は使用しない。もっとスマートなやり方がある気がするけど。
content0.descriptionLabel.text = "hello world" // descriptionLabel が IBOutlet のビュー
}
@ichiroc
ichiroc / file0.swift
Created February 12, 2016 21:33
透明な背景色のビューを作る ref: http://qiita.com/ichiroc@github/items/326b55de2430938e85ec
view.opaque = false // 不透明を false
view.backgroundColor = UIColor.init(colorLiteralRed: 0, green: 0, blue: 0, alpha: 0) // alpha 0 で色を設定
@ichiroc
ichiroc / file0.swift
Created January 21, 2016 21:32
AutoLayout でレイアウトした コンテナ ViewController 内の ViewController をアニメーションして入れ替える ref: http://qiita.com/ichiroc@github/items/a2142e2898728dd34a55
func transientToViewController(newMainVC : UIViewController ){
let currentVC = self.currentVC // この例ではインスタンス変数で保持しています。もしくは引数で渡したりしてください。
currentVC.willMoveToParentViewController(nil)
self.addChildViewController(newMainVC)
self.view.addSubview(newMainVC.view)
// アニメーション開始前の初期位置を設定 ここでは上部からスライドするように設定
let width = currentVC.view.bounds.size.width
let height = currentVC.view.bounds.size.height
newMainVC.view.frame = CGRectMake(0 , -height ,width,height)