Skip to content

Instantly share code, notes, and snippets.

>>> def my_merge(l1, l2):
print 'merge start', l1, l2
merge_list = []
while len(l1) > 0 and len(l2) > 0:
if l1[0] <= l2[0]:
merge_list.append(l1.pop(0))
else:
merge_list.append(l2.pop(0))
if len(l1) == 0:
merge_list += l2
>>> def side_effects_kwarg(kwarg = []):
... kwarg.append(1)
... return kwarg
...
>>> side_effects_kwarg()
Out[9]: [1]
>>> side_effects_kwarg()
Out[10]: [1, 1]
>>> side_effects_kwarg([])
Out[11]: [1]
<?php
class SimpleClass
{
public $str = 'a';
public $int = 1;
public $float = 1.0;
public $ary = array();
public $clsSame = null;
public $clsOther = null;
public $func = null;
@ksomemo
ksomemo / mongodb.md
Created January 29, 2014 02:23
mongoDbまとめ

MongoDBまとめ

##概要

  • インメモリ
  • クラスタ構成
  • スキーマフリー
  • ドキュメント指向
  • レプリケーション
  • シャーディング
@ksomemo
ksomemo / PhpStorm.exe.vmoptions.old
Last active August 3, 2017 08:24
PhpStorm64.exe.vmoptions
-server
-Xms128m
-Xmx512m
-XX:MaxPermSize=250m
-XX:ReservedCodeCacheSize=64m
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-XX:+UseCodeCacheFlushing
-XX:+UseConcMarkSweepGC
#!/bin/sh
wget http://sourceforge.net/projects/zsh/files/zsh/5.0.0/zsh-5.0.0.tar.gz/download
tar zxvf zsh-5.0.0.tar.gz
cd zsh-5.0.0
./configure
make
sudo make install
chsh -s `which zsh`
REPO_DIR=git-pack-gc
LINE_NUM=100000 #000
FILE_NAME=numbers.txt
GIT_OBJECTS_DIR='.git/objects'
echo "mkdir and git init"
mkdir ${REPO_DIR}
cd ${REPO_DIR}
git init
@ksomemo
ksomemo / gist-h-command.txt
Created November 2, 2013 19:11
gist -h | gist -f gist-h-command.txt -d this.
Gist (v4.1.1) lets you upload to https://gist.github.com/
The content to be uploaded can be passed as a list of files, if none are
specified STDIN will be read. The default filename for STDIN is "a.rb", and all
filenames can be overridden by repeating the "-f" flag. The most useful reason
to do this is to change the syntax highlighting.
If you'd like your gists to be associated with your GitHub account, so that you
can edit them and find them in future, first use `gist --login` to obtain an
Oauth2 access token. This is stored and used by gist in the future.
@ksomemo
ksomemo / svn_commit_symbolic_link.sh
Created June 28, 2013 07:27
svnで対象をsymbolic linkに変更した際のcommit方法
@ksomemo
ksomemo / Jenkins_plugin_list.txt
Created June 25, 2013 05:45
Jenkins plugin list
Ant Plugin
Build Trigger Badge Plugin
Credentials Plugin
CVS Plugin
External Monitor Job Type Plugin
Javadoc Plugin
Jenkins GIT client plugin
Jenkins GIT plugin
Jenkins Multiple SCMs plugin
Jenkins Phing plugin