Skip to content

Instantly share code, notes, and snippets.

View githiro's full-sized avatar

Hiro githiro

  • Tokyo
View GitHub Profile
@nothingismagick
nothingismagick / caret.js
Last active April 16, 2024 10:09
Small script to detect caret pixel position in contenteditable div
/**
* Get the caret position in all cases
*
* @returns {object} left, top distance in pixels
*/
getCaretTopPoint () {
const sel = document.getSelection()
const r = sel.getRangeAt(0)
let rect
let r2
@eolant
eolant / Confirm.vue
Last active March 23, 2024 08:48
Vuetify Confirm Dialog component that can be used locally or globally
<template>
<v-dialog v-model="dialog" :max-width="options.width" :style="{ zIndex: options.zIndex }" @keydown.esc="cancel">
<v-card>
<v-toolbar dark :color="options.color" dense flat>
<v-toolbar-title class="white--text">{{ title }}</v-toolbar-title>
</v-toolbar>
<v-card-text v-show="!!message" class="pa-4">{{ message }}</v-card-text>
<v-card-actions class="pt-0">
<v-spacer></v-spacer>
<v-btn color="primary darken-1" text @click.native="agree">Yes</v-btn>
@YoshihideSogawa
YoshihideSogawa / Purchaser.cs
Created May 19, 2016 07:42
UnityIAPでハマりながら作ったクラス
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Purchasing;
/// <summary>
/// 課金処理を扱うクラスです。
/// 非消費、サブスクリプション型は動作未検証です。
/// Android/iOSのみ動作検証しています。
/// INFO:[iOS]未購入のアイテムがあるとInitialize後すぐに認証ダイアログが表示されるので、呼び出すタイミングを調整してください
#!/bin/bash -x
# Description:L2TP/IPsec for CentOS7 64bit
# 2015/05/09 @mix3
(
## setting
cat << _SECRETS_ > /tmp/SECRETS_TMP.txt
#==============================================
# username auth_server password auth_ipaddress
@pburtchaell
pburtchaell / styles.css
Last active February 25, 2024 12:24
VH and VW units can cause issues on iOS devices. To overcome this, create media queries that target the width, height, and orientation of iOS devices.
/**
* VH and VW units can cause issues on iOS devices: http://caniuse.com/#feat=viewport-units
*
* To overcome this, create media queries that target the width, height, and orientation of iOS devices.
* It isn't optimal, but there is really no other way to solve the problem. In this example, I am fixing
* the height of element `.foo` —which is a full width and height cover image.
*
* iOS Resolution Quick Reference: http://www.iosres.com/
*/
@joaocunha
joaocunha / How To Hide The Select Arrow On Firefox.md
Last active December 10, 2023 13:05
How to hide <select> dropdown's arrow in Firefox when using "-moz-appearance: none;".

This is no longer a bug. I'm keeping the gist for historical reasons, as it helped to get it fixed. Make sure to read the notes by the end of the post.

How to remove hide the select arrow in Firefox using -moz-appearance:none;

TL;DR (or, the fix)

  1. Set -moz-appearance to none. This will "reset" the styling of the element;
  2. Set text-indent to 0.01px. This will "push" the text a tiny bit[1] to the right;
@tsubaki
tsubaki / Loby.cs
Created July 4, 2013 15:18
Photon Cloudのロビーほぼ最小構成
using UnityEngine;
using System.Collections;
public class Loby : MonoBehaviour
{
void OnEnable ()
{
// サーバー接続
PhotonNetwork.ConnectUsingSettings ("0.1");
}
@wizard-paso
wizard-paso / SublimeText2Memo.md
Last active July 30, 2021 23:02
Sublime Text 2 Windows版メモです

Sublime Text 2 memo (Windows)

最低限やっておくべきこと

インストール

portable versionでも良いが、インストールしていないと、縦に選択等のAltキーを使用するショートカットが使えなかった。

Sublime Package Controlのインストール

@hayajo
hayajo / changelog_en.md
Last active May 3, 2024 08:29
ChangeLog を支える英語

ChangeLog を支える英語

ChangeLog を書く際によく使われる英語をまとめました。

ほとんど引用です。

基本形

@anon5r
anon5r / iOS絵文字抽出用正規表現
Last active October 11, 2018 02:33
iOSで扱われるUnicode 6.0絵文字の判定をする正規表現
# 実際の利用時には、途中の改行、および # で始まるコメント行は削除してね
/(?:
# 合成文字系
# 数値
(?:(?:\x0023|[\x0030-x0039])\x20E3)|
# 国旗
(?:\x1F1E8\x1F1F3|\x1F1E9\x1F1EA|\x1F1EA\x1F1F8|\x1F1EB\x1F1F7|\x1F1EC\x1F1E7|\x1F1EE\x1F1F9|\x1F1EF\x1F1F5|\x1F1F0\x1F1F7|\x1F1F7\x1F1FA|\x1F1FA\x1F1F8)|
# 合成文字ここまで
# 以下単体文字(絵文字)
(?:\x00A9|\x00AE|\x2002|\x2003|\x2005|\x203C|\x2049|\x2122|\x2139|[\x2194-x2199]|\x21A9|\x21AA|\x231A|\x231B|\x23E9|\x23EA|\x23EB|\x23EC|\x23F0|\x23F3|\x24C2|\x25AA|\x25AB|\x25B6|\x25C0|\x25FB|\x25FC|\x25FD|\x25FE|\x2600|\x2601|\x260E|\x2611|\x2614|\x2615|\x261D|\x263A|\x2648|\x2649|\x264A|\x264B|\x264C|\x264D|\x264E|\x264F|\x2650|\x2651|\x2652|\x2653|\x2660|\x2663|\x2665|\x2666|\x2668|\x267B|\x267F|\x2693|\x26A0|\x26A1|\x26AA|\x26AB|\x26BD|\x26BE|\x26C4|\x26C5|\x26CE|\x26D4|\x26EA|\x26F2|\x26F3|\x26F5|\x26FA|\x26FD|\x2702|\x2705|\x2708|\x2709|\x270A|\x270B|\x270C|\x270F|\x2712|\x2714|\x2716|\x2728|\x2733|\x2734|\x2744|\x2747|\x274C|\x274E|\x2753|\x2754|\x2755|\x2757|\x2764|\x2795|\x2796|\x2797|\x27A1|\x27B0|\x2934|\x2935|\x2B05|\x2B0