readme.md

input type=“file” なやつを独自にデザインする方法 [CSS]フォームの input type=file のボタンデザインを変更する方法

2015年6月23日 · 1 分

Django: ファイルフィールドのコピー

>>> from campaign.models import * >>> Application.objects.all() [<Application: Application object>] >>> a = _[0] >>> a.receipt_photo.path u'/home/vagrant/projects/our-site/web/protected/campaign_application/receipt_photo/01.jpg' $ tree protected/ protected/ └── campaign_application └── receipt_photo └── 01.jpg 2 directories, 1 file >>> n = Application() >>> n.receipt_photo.save('copy.jpg', a.receipt_photo.file) >>> n.save() >>> Application.objects.all() [<Application: Application object>, <Application: Application object>] >>> Application.objects.all()[1].receipt_photo.path u'/home/vagrant/projects/our-site/web/protected/campaign_application/receipt_photo/copy.jpg' $ tree protected/ protected/ └── campaign_application └── receipt_photo ├── 01.jpg └── copy.jpg 2 directories, 2 files $ sha1sum protected/campaign_application/receipt_photo/* a97c2b07232242e96506914cadfbc08ea7efb712 protected/campaign_application/receipt_photo/01.jpg a97c2b07232242e96506914cadfbc08ea7efb712 protected/campaign_application/receipt_photo/copy.jpg

2015年6月16日 · 1 分

Redis Windows

Redis-64 on Windows Install C:\Users\hdknr>choco install redis-64 Chocolatey v0.9.9.2 Installing the following packages: redis-64 By installing you accept licenses for the packages. redis-64 v2.8.19 ShimGen has successfully created a shim for redis-benchmark.exe ShimGen has successfully created a shim for redis-check-aof.exe ShimGen has successfully created a shim for redis-check-dump.exe ShimGen has successfully created a shim for redis-cli.exe ShimGen has successfully created a shim for redis-server.exe redis-64 has been installed successfully. Chocolatey installed 1/1 package(s). 0 package(s) failed. See the log for details. redis-server C:\Users\hdknr>redis-server [7308] 21 Apr 10:26:02.432 # Warning: no config file specified, using the defaul t config. In order to specify a config file use C:\ProgramData\chocolatey\lib\redis-64\redis-server.exe /path/to/redis.conf _._ _.-``__ ''-._ _.-`` `. `_. ''-._ Redis 2.8.19 (00000000/0) 64 bit .-`` .-```. ```\/ _.,_ ''-._ ( ' , .-` | `, ) Running in stand alone mode |`-._`-...-` __...-.``-._|'` _.-'| Port: 6379 | `-._ `._ / _.-' | PID: 7308 `-._ `-._ `-./ _.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | http://redis.io `-._ `-._`-.__.-'_.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | `-._ `-._`-.__.-'_.-' _.-' `-._ `-.__.-' _.-' `-._ _.-' `-.__.-' [7308] 21 Apr 10:26:02.455 # Server started, Redis version 2.8.19 [7308] 21 Apr 10:26:02.456 * The server is now ready to accept connections on port 6379 redis-cli C:\Users\hdknr>redis-cli 127.0.0.1:6379> set testkey testvalue OK 127.0.0.1:6379> get testkey "testvalue" 127.0.0.1:6379> StackExchange.Redis NuGet PM> Install-Package StackExchange.Redis Windows Forms 1 2 3 4 5 6 7 8 private void button1_Click(object sender, EventArgs e) { var connect = StackExchange.Redis.ConnectionMultiplexer.Connect("localhost"); var cb = connect.GetDatabase(); // StackExchange.Redis.IDatabase cb.StringSet("name", "hdknr"); MessageBox.Show(cb.StringGet("name")); } Console Client 127.0.0.1:6379> get name "hdknr"

2015年4月21日 · 2 分

Photon Note

Service shutting down: with Exception (1). Errorcode: 6 the maximum timeout that we can set? photon server shutdown after X second OnDisconnect is not called sometimes ?

2015年4月6日 · 1 分

Configure Windows Git ssh

git mv “permission denied git mv “permission denied” レポジトリのフォルダーから explorer 起動している?閉じてください。 .gitignore .gitignore for Visual Studio Projects and Solutions ssh関連 C:\Users\hdknr>where ssh-keygen C:\ProgramData\chocolatey\bin\ssh-keygen C:\ProgramData\chocolatey\bin\ssh-keygen.bat C:\Users\hdknr\Documents\hoge>ssh-keygen -b 4096 -f \Users\hdknr\.ssh\win8.key Generating public/private rsa key pair. cygwin warning: MS-DOS style path detected: \Users\hdknr\.ssh\win8.key Preferred POSIX equivalent is: /cygdrive/c/Users/hdknr/.ssh/win8.key CYGWIN environment variable option "nodosfilewarning" turns off this warning. Consult the user's guide for more details about POSIX paths: http://cygwin.com/cygwin-ug-net/using.html#using-pathnames Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in \Users\hdknr\.ssh\win8.key. Your public key has been saved in \Users\hdknr\.ssh\win8.key.pub. The key fingerprint is: 93:66:5a:0e:7b:e4:a1:2d:fc:ee:46:4f:46:1c:07:fa hdknr@Blacky The key's randomart image is: +--[ RSA 4096]----+ | .. | | .. . | | .. o | | oo | | . S.E | | . &.oo | | *.=+ | | +. . | | ++ | +-----------------+ C:\Users\hdknr\Documents\hoge> C:\Users\hdknr\Documents\hoge>dir \Users\hdknr\.ssh ドライブ C のボリューム ラベルは Acer です ボリューム シリアル番号は 9AAA-8637 です C:\Users\hdknr\.ssh のディレクトリ 2015/03/29 17:35 <DIR> . 2015/03/29 17:35 <DIR> .. 2015/03/29 16:51 410 known_hosts 2015/03/29 17:35 3,243 win8.key 2015/03/29 17:35 738 win8.key.pub 5 個のファイル 8,372 バイト 2 個のディレクトリ 807,079,927,808 バイトの空き領域 C:\Users\hdknr\Documents\hoge>where git C:\Program Files (x86)\Git\cmd\git.exe C:\Users\hdknr\Documents\hoge>cd C:\Program Files (x86)\Git\etc C:\Program Files (x86)\Git\etc> C:\Program Files (x86)\Git\etc>mkdir ssh C:\Program Files (x86)\Git\etc>gvim ssh\ssh_config C:\Program Files (x86)\Git\etc>more ssh\ssh_config Host bitbucket.org IdentityFile C:\Users\hdknr\.ssh\win8.key C:\Users\hdknr\Documents\hoge>git clone git@bitbucket.org:hdknr/photo.git Cloning into 'photo'... remote: Counting objects: 33, done. remote: Compressing objects: 100% (31/31), done. remote: Total 33 (delta 1), reused 0 (delta 0) Receiving objects: 100% (33/33), 9.72 MiB | 400.00 KiB/s, done. Resolving deltas: 100% (1/1), done. Checking connectivity... done.

2015年3月29日 · 2 分

Python VCS

https://pythonhosted.org/vcs/api/index.html https://pypi.python.org/pypi/RhodeCode https://code.rhodecode.com/ RhodeCode Requirements Waitress WSGI server [WebOb provides wrappers around the WSGI request environment, and an object to help create WSGI responses.](WebOb provides wrappers around the WSGI request environment, and an object to help create WSGI responses.) FormEncode validates and converts nested structures.

2015年3月5日 · 1 分

Django Jade

Use Jade Templates In Django How to combine Django with Jade

2015年3月3日 · 1 分

PNGファイルの連結

imagemagick install $ brew install ImageMagick ==> Downloading https://homebrew.bintray.com/bottles/imagemagick-6.9.0-3.yosemite.bottle.tar.gz ######################################################################## 100.0% ==> Pouring imagemagick-6.9.0-3.yosemite.bottle.tar.gz Error: The `brew link` step did not complete successfully The formula built, but is not symlinked into /usr/local Could not symlink bin/convert Target /usr/local/bin/convert already exists. You may want to remove it: rm '/usr/local/bin/convert' To force the link and overwrite all conflicting files: brew link --overwrite imagemagick To list all files that would be deleted: brew link --overwrite --dry-run imagemagick Possible conflicting files are: /usr/local/bin/convert /usr/local/share/man/man1/convert.1 ==> Summary 🍺 /usr/local/Cellar/imagemagick/6.9.0-3: 1440 files, 22M $ rm '/usr/local/bin/convert' override rwxr-xr-x root/wheel for /usr/local/bin/convert? yes $ ls /usr/local/bin/convert ls: /usr/local/bin/convert: No such file or directory $ brew link --overwrite imagemagick Linking /usr/local/Cellar/imagemagick/6.9.0-3... 71 symlinks created

2015年3月1日 · 1 分

jQueryUI

Autocomplete Widget AutoCompleteウィジェットの検索/表示方法をカスタマイズするには? jQuery UI - オートコンプリート source source#1. 配列 文字列配列 [ "Choice1", "Choice2" ] オブジェクト配列( obj.label, obj.value ) value = value or label [ { label: "Choice1", value: "value1" }, ... ] source#2. URI GET source_uri?term=入力文字列 source#3. 関数 source : function(request, response){ var iput = response.term; response([ var1, var2, ...] ); } Sample with a Django Model 1 2 3 4 5 6 7 8 9 10 11 12 13 14 var entities = {% to_json entities %}; // serializers.serialize('json', entities) $( "input.entity-title" ).autocomplete({ delay: 0, source: $.map(entities, function(val, index){ return { label: val['fields']['name'], value: val['fields']['id'], model: val}; }), select: function(e, ui) { alert(ui.item.model['fields']['created_at']); } });

2015年2月26日 · 1 分

Boostrap : nav

navbar navbar-brand navbar-collapse navbar-default navbar-form navbar-header navbar-nav navbar-toggle navbar-left navbar-btn navbar-text navbar-link navbar-right navbar-fixed-top navbar-fixed-bottom navbar-static-top navbar-inverse

2015年2月25日 · 1 分