Skip to content

Instantly share code, notes, and snippets.

View gaishimo's full-sized avatar
🏠
Coding 💻

gaishimo gaishimo

🏠
Coding 💻
View GitHub Profile
TypeScript 24 hrs 37 mins ████████████████▊░░░░ 79.8%
Markdown 2 hrs 45 mins █▉░░░░░░░░░░░░░░░░░░░ 9.0%
JSON 2 hrs 38 mins █▊░░░░░░░░░░░░░░░░░░░ 8.6%
Other 33 mins ▍░░░░░░░░░░░░░░░░░░░░ 1.8%
Bash 8 mins ░░░░░░░░░░░░░░░░░░░░░ 0.5%
// @flow
import React, { Component } from 'react';
import {
StyleSheet,
View,
PanResponder,
} from 'react-native';
type State = {
// @flow
import React, { Component } from 'react';
import {
Platform,
StyleSheet,
Text,
View,
TouchableOpacity,
TouchableHighlight,
@gaishimo
gaishimo / class_method_hook.rb
Created February 5, 2016 11:02
class method hook
module Module1
def self.method1
puts "method1 is called."
end
end
class Test
def self.method_missing(name, *args)
if Module1.method_defined?(name)
puts "don't call me!!!!!"
@gaishimo
gaishimo / monit
Created June 4, 2014 23:47 — forked from rahul286/monit
#!/bin/sh
# move this file to /etc/init.d/monit
### BEGIN INIT INFO
# Provides: monit
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Should-Start: $all
# Should-Stop: $all
@gaishimo
gaishimo / conyac.php
Last active August 29, 2015 13:57
Conyac API PHP Client
<?php
/**
* Conyac API Client for PHP
* @author gaishimo
*/
class Conyac{
private $apiDomain;
private $clientId;
#!/bin/sh
if [ $# -lt 1 ]; then echo "Usage: add_ssh_public_key.sh <host> [<user>] [<port>]"; exit 1; fi
HOST=$1 USER=$2 PORT=$3
if [ -z $USER ]; then USER=`whoami`; fi
if [ -z $PORT ]; then PORT=22; fi
STATUS=`cat ~/.ssh/id_rsa.pub |
ssh -p $PORT $USER@$HOST "sh -c 'cat - >> ~/.ssh/authorized_keys; echo \\$?'"`
if [ "$STATUS" != "0" ]; then
@gaishimo
gaishimo / rspec.sh
Created August 20, 2013 01:21
RSpec 特定のテストだけ実行する
$ bundle exec rspec spec/requests/user_pages_spec.rb \
-e "signup with invalid information"
@gaishimo
gaishimo / render.rb
Created August 3, 2013 10:49
Controller : render
respond_to do |format|
if @magazine.save
format.html { redirect_to @magazine, notice: 'Magazine was successfully created.' }
format.json { render json: @magazine, status: :created, location: @magazine }
else
format.html { render action: "new" }
format.json { render json: @magazine.errors, status: :unprocessable_entity }
end
end
@gaishimo
gaishimo / set_timezone.sql
Created August 3, 2013 01:37
My SQLのタイムゾーン設定
SHOW VARIABLES like '%time_zone%';
SET GLOBAL time_zone = '+9:00';