Skip to content

Instantly share code, notes, and snippets.

Avatar
😇
in heaven

Masatsugu Omiya letsspeak

😇
in heaven
View GitHub Profile
@letsspeak
letsspeak / Makefile
Created Dec 15, 2017
vs Redmine Textile Solution
View Makefile
# markdown files
MARKDOWNS = $(wildcard *.md)
# converted textiles
TEXTILES = $(patsubst %.md,%.textile,$(MARKDOWNS))
all: $(TEXTILES)
README.textile: README.md
@echo 'skipping README.textile conversion'
@letsspeak
letsspeak / MyClass.java
Last active Dec 11, 2017
Java Calendar add can beyond the XXX_OF boundary and Calendar date comparision test code
View MyClass.java
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
public class MyClass {
public static void main(String args[]) {
// Don be afraid that add(DAY_OF〜, value) makes no differences
@letsspeak
letsspeak / log.sh
Created Oct 23, 2017
fix gem trouble for high sierra
View log.sh
$ gem install aws-sdk
Fetching: jmespath-1.3.1.gem (100%)
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory.
$ which ruby
/usr/bin/ruby
$ which gem
/usr/bin/gem
$ brew install rbenv ruby-build
$ rbenv install --list
@letsspeak
letsspeak / example.swift
Last active Oct 10, 2017
Swift optional is empty or nil
View example.swift
//
// check if array is empty or nil
//
class Example {
func check(_ array: [String]?) {
if (array ?? []).isEmpty == true {
print("array is empty or nil")
} else {
print("array is not empty or nil")
@letsspeak
letsspeak / result
Last active Feb 22, 2017
shukujitu
View result
2016/01/01,元日
2016/01/11,成人の日
2016/02/11,建国記念の日
2016/03/20,春分の日
2016/04/29,昭和の日
2016/05/03,憲法記念日
2016/05/04,みどりの日
2016/05/05,こどもの日
2016/07/18,海の日
2016/08/11,山の日
View ReactInstall.md

React.js環境構築(未完)

VSCodeの導入

  • VSCodeをインストール
  • View Command Palette...(⇧⌘P or F1) -> Configure Language -> "ja" を "en" に変更保存して再起動すると英語化
  • View -> Extensions(⇧⌘X) -> @sort:installs vim でVim拡張導入

VSCodeの操作や設定など

View emon
call accelerate#map('nv', 'e', '<C-u>', 'repeat("\<C-u>", v:count1)')
call accelerate#map('nv', 'e', '<C-d>', 'repeat("\<C-d>", v:count1)')
call accelerate#map('nv', '', 'j', 'gj')
call accelerate#map('nv', '', 'k', 'gk')
call accelerate#map('nv', '', 'h', 'h')
call accelerate#map('nv', 'e', 'l', 'foldclosed(line(".")) != -1 ? "zo" : "l"')
View gist:9207746
git branch | awk '/^*/{print $2}' | xargs -I% git push origin %
こんな感じでなんとか出来ないだろうか
@letsspeak
letsspeak / mysql.rake
Last active Dec 31, 2015
Ruby on Rails mysql backup rake task
View mysql.rake
# encoding: utf-8
namespace :mysql do
desc 'backup mysql database'
task :backup => :environment do
filename = "#{Rails.root}/config/database.yml"
config = YAML::load(File.open(filename))[Rails.env]
if config.nil?
@letsspeak
letsspeak / nicolive.rb
Created Aug 21, 2013
nicolive rtmpdump support script
View nicolive.rb
require "net/http"
require "net/https"
require "uri"
require "rexml/document"
class NicoLiveException < StandardError; end
class NicoLive
attr_accessor :mail_tel, :password