Skip to content

Instantly share code, notes, and snippets.

Yuka O'oka oukayuka

Block or report user

Report or block oukayuka

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@oukayuka
oukayuka / axiosInterceptor.ts
Last active Apr 9, 2019
axios のレスポンスからスネークケースのキーをキャメルケースに変換して、日付をDateTimeオブジェクトにする
View axiosInterceptor.ts
import { AxiosResponse } from 'axios';
import { camel } from 'change-case';
import { isArray, isObject, isString } from 'lodash';
import { DateTime } from 'luxon';
export const reform = (
obj: object,
keyConverter: (k: string) => string,
): any => {
if (isArray(obj)) {
@oukayuka
oukayuka / keybindings.json
Last active Apr 26, 2018
VSCode Vim plugin undo / redo settings
View keybindings.json
[
{
"key": "ctrl+]",
"command": "extension.vim_escape",
"when": "editorTextFocus"
},
{
"key": "ctrl+e",
"command": "workbench.action.toggleSidebarVisibility"
},
@oukayuka
oukayuka / tslint.json
Created Feb 12, 2018
My TSLint configuration
View tslint.json
{
"extends": [
"tslint:latest",
"tslint-config-airbnb",
"tslint-config-prettier",
"tslint-eslint-rules",
"tslint-react"
],
"rulesDirectory": [
"tslint-plugin-prettier"
@oukayuka
oukayuka / FlashMessage.tsx
Last active Jun 19, 2019
Recompose withStateHandlers with TypeScript
View FlashMessage.tsx
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;
}
@oukayuka
oukayuka / UserSearchForm.tsx
Last active Sep 15, 2019
Formik sample with TypeScript
View UserSearchForm.tsx
import { InjectedFormikProps, withFormik } from 'formik';
import * as React from 'react';
import * as Yup from 'yup';
interface FormValues {
login: string;
}
interface FormProps {
login?: string;
@oukayuka
oukayuka / trgm.patch
Last active Dec 17, 2015
PostgreSQLのpg_trgmでマルチバイト文字を使えるようにするためのHomebrewパッチ。
View trgm.patch
--- a/contrib/pg_trgm/trgm.h 2013-05-14 11:20:48.000000000 +0900
+++ b/contrib/pg_trgm/trgm.h 2013-05-14 11:20:42.000000000 +0900
@@ -12,7 +12,7 @@
/* options */
#define LPADDING 2
#define RPADDING 1
-#define KEEPONLYALNUM
+/* #define KEEPONLYALNUM */
/*
* Caution: IGNORECASE macro means that trigrams are case-insensitive.
@oukayuka
oukayuka / fb_test_users.sh
Created Jul 7, 2011
A shell Script that creates/reads/deletes Facebook app test users.
View fb_test_users.sh
#!/bin/sh
CLIENT_ID={MY_CLIENT_ID} # Please EDIT
CLIENT_SECRET={MY_CLIENT_SECRET} # Please EDIT
# handling params
MODE="READ"
if [ $# -eq 1 ]; then
if [ $1 = "-c" ]; then
MODE="CREATE"
else
@oukayuka
oukayuka / inputmode.rb
Created Jul 23, 2009
Setting default input mode to text form for mobile client.
View inputmode.rb
module ActionView
module Helpers
module FormHelper
alias :text_field_without_inputmode :text_field
# ==== Options
# * <tt>:inputmode</tt> - 入力モード。Jpmobile::InputMode::HIRAGANA-全角ひらがな、Jpmobile::InputMode::HANKAKUKANA-半角カナ、Jpmobile::InputMode::ALPHABET-半角英字、Jpmobile::InputMode::NUMERIC-半角数字
# ==== Examples
# text_field_tag(:user, :name, :size => 20, :inputmode => Jpmobile::InputMode::HIRAGANA)
# # => <input id="name" name="name" type="text" size="20" istyle="1" style="-wap-input-format:&quot;&lt;ja:h&gt;&quot;">
View au.rb
module Jpmobile::Mobile
class Au < AbstractMobile
def supports_cookie?
if @request.protocol =~ /\Ahttps/
false
else
true
end
end
end
You can’t perform that action at this time.