Skip to content

Instantly share code, notes, and snippets.

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

Mamoru Amano mamoru0217

🏠
Working from home
View GitHub Profile
@terrancesnyder
terrancesnyder / regex-japanese.txt
Created November 7, 2011 14:05
Regex for Japanese
Regex for matching ALL Japanese common & uncommon Kanji (4e00 – 9fcf) ~ The Big Kahuna!
([一-龯])
Regex for matching Hirgana or Katakana
([ぁ-んァ-ン])
Regex for matching Non-Hirgana or Non-Katakana
([^ぁ-んァ-ン])
Regex for matching Hirgana or Katakana or basic punctuation (、。’)
@jcieslar
jcieslar / thumb_service.rb
Last active July 19, 2023 22:47
Create video thumbnails - ruby
movie = FFMPEG::Movie.new(video_url)
duration = (movie.duration / 2).floor
movie.screenshot("#{thumb_url}.jpg", seek_time: duration)
@voluntas
voluntas / webrtc.rst
Last active July 31, 2024 08:34
WebRTC コトハジメ
@xl1
xl1 / gist:fe779a817a9d4938193d
Last active May 6, 2024 03:35
Facebook API: 有効期限の長い Access Token を取得する

Facebook API: 有効期限の長い Access Token を取得する

tl;dr

  1. User Access Token を取得する
  2. それを使って長い期限のトークンを取得する
  3. /me/accounts?access_token={long_lived_token}
  4. 無期限のトークンが手に入る

API のバージョン

@nrollr
nrollr / MySQL_macOS_Sierra.md
Last active June 7, 2024 20:53
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

@teameh
teameh / PanResponder_Overview.js
Last active October 21, 2023 05:28
React native PanResponder interface overview
this._panResponder = PanResponder.create({
// ----------- NEGOTIATION:
// A view can become the touch responder by implementing the correct negotiation methods.
// Should child views be prevented from becoming responder on first touch?
onStartShouldSetPanResponderCapture: (evt, gestureState) => () => {
console.info('onStartShouldSetPanResponderCapture');
return true;
},
/* @flow */
import { Permissions, Notifications } from 'expo'
// This code does not work on emulator
async function registerPushNotificationService() {
const { status } = await Permissions.askAsync(
Permissions.REMOTE_NOTIFICATIONS
)
if (status !== 'granted') {
return
@oukayuka
oukayuka / FlashMessage.tsx
Last active August 6, 2020 12:39
Recompose withStateHandlers with TypeScript
import * as React from 'react';
import { compose, lifecycle, pure, StateHandler, StateHandlerMap, withStateHandlers } from 'recompose';
import { Message, Transition } from 'semantic-ui-react';
import './FlashMessage.css';
export interface FlashMessageProps {
message: string;
isWarning?: boolean;
}