Skip to content

Instantly share code, notes, and snippets.

@byplayer
byplayer / gist:eddd3ccd52f0d9fe6099346d2924b763
Created March 22, 2018 02:06
Hyper-V disable/enable on windows
Hyper-V disable
bcdedit /set hypervisorlaunchtype off
Hyper-V enable
bcdedit /set hypervisorlaunchtype auto
@byplayer
byplayer / packer.sh
Last active July 30, 2021 03:08
packer to build ubuntu box
# packer https://www.packer.io/
# update pakcer before run
# get token token
https://app.vagrantup.com/settings/security
VAGRANT_CLOUD_TOKEN=
VUSER=
BOX_NAME=ubuntu2104-lubuntu
public class VersionHelper {
/**
* Compares one version string to another version string by dotted ordinals.
* eg. "1.0" > "0.09" ; "0.9.5" < "0.10",
* also "1.0" < "1.0.0" but "1.0" == "01.00"
*
* ref: https://stackoverflow.com/questions/6701948/efficient-way-to-compare-version-strings-in-java
*
* @param left the left hand version string
TodoTxtJs.TodoManager._compareDueDate = function (left, right) {
if (left.dueDate() || right.dueDate()) {
if (!left.dueDate())
return 1;
if (!right.dueDate())
return -1;
if (left.dueDate().getFullYear() !== right.dueDate().getFullYear()
|| left.dueDate().getMonth() !== right.dueDate().getMonth()
|| left.dueDate().getDay() !== right.dueDate().getDay()) {
return left.dueDate() < right.dueDate() ? -1 : 1;
sudo apt-get install python-dev
env LC_ALL=C pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl \
--user
# check dependency
# mvn dependency:tree
# run test server
mvn spring-boot:run
# make destributable package
mvn package
g clone https://github.com/ruby/ruby.git
cd ruby
autoconf
./configure --enable-shared --prefix=${HOME}/ruby-build/
make
make test
@byplayer
byplayer / XCode_cheat_sheet.md
Last active August 29, 2015 14:09
XCode cheat sheet

header/source 切り替え

Ctrl+Cmd+↑

メソッド名のリストを表示してジャンプする

Show Document Items ^6

@byplayer
byplayer / study.js
Created November 7, 2014 05:33
MongoDB study
$ mongo
use sample1
db.unicorns.insert({name: 'Aurora', gender: 'f', weight: 450})
db.unicorns.find()
db.system.indexes.find()
db.unicorns.insert({name: 'Leto', gender: 'm', home: 'Arrakeen', worm: false})
@byplayer
byplayer / node_memo.txt
Created November 4, 2014 02:45
node_memo
テスト https://www.npmjs.org/package/mocha
BDD https://www.npmjs.org/package/should
カバレッジ計測 https://www.npmjs.org/package/istanbul
Redisモック https://www.npmjs.org/package/node-redis-mock
モジュール読み込みをスタブする https://www.npmjs.org/package/sandboxed-module
スタブ・モック https://www.npmjs.org/package/sinon
自動化(いろいろ) https://www.npmjs.org/package/grunt