Skip to content

Instantly share code, notes, and snippets.

View takuan-osho's full-sized avatar
🏠
Working from home

SHIMIZU Taku takuan-osho

🏠
Working from home
View GitHub Profile
@takuan-osho
takuan-osho / file0.txt
Created January 21, 2016 08:18
管理者権限が無くてもPowerShellのスクリプトを実行できるようにする方法 ref: http://qiita.com/takuan_osho/items/1cbcc9e06b016f658b49
D:\Users\taku>powershell -ExecutionPolicy RemoteSigned
Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.
PS D:\Users\taku> Get-ExecutionPolicy
RemoteSigned
@takuan-osho
takuan-osho / file0.txt
Last active January 12, 2016 13:30
Homebrewを使って入れたMySQLが動かない状態に陥った下らない原因 ref: http://qiita.com/takuan_osho/items/961b95373920c3a22aa5
$ mysqld --initialize-insecure --user=taku --basedir=/usr/local/Cellar/mysql/5.7.10 --datadir=/usr/local/var/mysql --tmpdir=/tmp --explicit_defaults_for_timestamp
2016-01-12T11:35:11.104978Z 0 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
100
100
2016-01-12T11:35:27.326652Z 0 [Warning] InnoDB: New log files created, LSN=45790
2016-01-12T11:35:28.053387Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2016-01-12T11:35:28.110798Z 0 [ERROR] unknown variable 'innodb_additional_mem_pool_size=16M'
2016-01-12T11:35:28.110818Z 0 [ERROR] Aborting
@takuan-osho
takuan-osho / sample.js
Created January 9, 2016 08:16
JavaScript初心者がES2015をReactとかに適用する時に色々ハマったことのちょっとしたまとめ ref: http://qiita.com/takuan_osho/items/c938ef0d4a7ed11a159f
var MyComponent = React.createClass({
getInitialState() {
return {
newTodo: ""
};
}
});
'use strict';
let nconf = require('nconf').file({file: getUserHome() + '/sound-machine-config.json'});
function saveSettings(settingKey, settingValue) {
nconf.set(settingKey, settingValue);
nconf.save();
}
function readSettings(settingKey) {
@takuan-osho
takuan-osho / main.rb
Last active January 25, 2018 07:35
住所表記ルールの表記ゆれ修正のためのスクリプト
#!/usr/bin/env ruby
require "./normalizer"
input_file = ARGV[0]
write_file = ARGV[1]
generate_normalized_file(input_file, write_file)
@takuan-osho
takuan-osho / CodePiece.swift
Last active October 3, 2015 05:33
Optional Bindingみたいなのをするこういう場合、if letとguardどっちを使えばメンテしやすくなるんだろ? #CodePiece
// Hacking with Swiftオリジナルのコード
// from https://www.hackingwithswift.com/read/4/3/choosing-a-website-uialertcontroller
func openPage(action: UIAlertAction!) {
let url = NSURL(string: "https://" + action.title!)!
webView.loadRequest(NSURLRequest(URL: url))
}
// if letを使って書きかえてみたコード
func openPage(action: UIAlertAction!){
if let title = action.title, let url = NSURL(string: "https://" + title) {
@takuan-osho
takuan-osho / gulpfile.js
Last active August 29, 2015 14:26
babel, react, browserify, browser-syncを活用したgulpfileのひな型
var gulp = require('gulp');
var gutil = require('gulp-util');
var sass = require('gulp-sass');
var source = require('vinyl-source-stream');
var babelify = require('babelify');
var watchify = require('watchify');
var exorcist = require('exorcist');
var browserify = require('browserify');
var browserSync = require('browser-sync').create();
@takuan-osho
takuan-osho / gulpfile.js
Created July 28, 2015 11:39
BrowserSyncを入れて動かしてみたgulpfile
var gulp = require("gulp");
var slim = require("gulp-slim");
var browserSync = require("browser-sync");
gulp.task('slim', function(){
gulp.src("./*.slim")
.pipe(slim({
pretty: true
}))
.pipe(gulp.dest("./output/"));