Skip to content

Instantly share code, notes, and snippets.

View DQNEO's full-sized avatar

Daisuke Kashiwagi DQNEO

View GitHub Profile
-<a class="post-star btn btn-default" data-method="post" data-post-id="5665" data-remote="true" href="/posts/5665/stars" rel="nofollow">
+<a class="post-star btn btn-default" data-method="post" data-post-id="5665" data-remote="true" href="/posts/5665/stars" rel="nofollow" title="テキストを選択してからクリックすると、コメントに残せます。">
<i class="icon-footprint"></i>
読んだよ
@DQNEO
DQNEO / mruby
Created February 16, 2014 14:32
~/repos/mruby% uname -a
CYGWIN_NT-6.1 DK-CFN9 1.7.27(0.271/5/3) 2013-12-09 11:54 x86_64 Cygwin
~/repos/mruby% git log -1 --oneline
41a7711 Merge pull request #1710 from takkaw/flo_to_str
~/repos/mruby% bin/mruby -e 'p 10**200, 10**-14'
1.0e+200
0
~/vagrants/awsconv% vagrant.bat provision
[fog][WARNING] Unable to load the 'unf' gem. Your AWS strings may not be properly encoded.
DL is deprecated, please use Fiddle
[default] Rsyncing folder: /cygdrive/C/cygwin64/home/DK/vagrants/awsconv/ => /vagrant
[default] Rsyncing folder: /cygdrive/C/cygwin64/home/DK/vagrants/awsconv/chefsolo/cookbooks/ => /tmp/vagrant-chef-1/chef-solo-1/cookbooks
[default] Rsyncing folder: /cygdrive/C/cygwin64/home/DK/vagrants/awsconv/chefsolo/roles/ => /tmp/vagrant-chef-1/chef-solo-2/roles
[default] Running provisioner: chef_solo...
The chef binary (either `chef-solo` or `chef-client`) was not found on
the VM and is required for chef provisioning. Please verify that chef
is installed and that the binary is available on the PATH.
@DQNEO
DQNEO / parse_ltsv.pl
Last active August 29, 2015 13:56
perl one liner to parse LTSV log
# 基本
cat access_log | perl -F'\t' -nale '%h=map{split/:/,$_,2}@F;print"$h{time}\t$h{ua}"'
# 行絞り込み
grep path:/images/ accesslog | perl -F'\t' -nale '%h=map{split/:/,$_,2}@F;print"$h{time}\t$h{ua}"'
# gz圧縮されたログを展開
gunzip -c access_log.1.gz | perl -F'\t' -nale '%h=map{split/:/,$_,2}@F;print"$h{time}\t$h{ua}"'
# 複数の圧縮ログを展開
gunzip -c access_log.*.gz | perl -F'\t' -nale '%h=map{split/:/,$_,2}@F;print"$h{time}\t$h{ua}"'
@DQNEO
DQNEO / ends_of_months.pl
Created February 23, 2014 09:06
指定年の各月の月末日を求めるスクリプト
use strict;
use warnings;
my $year = 2013;
my $ends = ends_of_month_of_year($year);
print $_."\n" for @$ends;
# 指定した年の各月末日を求める
sub ends_of_month_of_year {
my $year = shift;
@DQNEO
DQNEO / shell.log
Created February 24, 2014 14:16
rbenv install -v 2.1.1
~/.rbenv% rbenv install -v 2.1.1
Downloading ruby-2.1.1.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/e57fdbb8ed56e70c43f39c79da1654b2
/tmp/ruby-build.20140224231516.9252 ~/.rbenv
HTTP/1.1 200 OK
Content-Type: binary/octet-stream
Content-Length: 15092388
Connection: keep-alive
Date: Mon, 24 Feb 2014 13:13:01 GMT
Last-Modified: Mon, 24 Feb 2014 13:08:59 GMT
@DQNEO
DQNEO / echo_exception.php
Created March 18, 2014 01:17
PHPでExceptionをechoするとどうなるかのか
#!/usr/bin/env php
<?PHP
$obj = new Exception("hoge");;
echo "hello " . $obj->getMessage() . PHP_EOL;
echo "hello " . $obj . PHP_EOL;
@DQNEO
DQNEO / 0_reuse_code.js
Created March 20, 2014 04:54
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@DQNEO
DQNEO / javascript_resources.md
Created March 21, 2014 05:51 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@DQNEO
DQNEO / init.el
Created March 21, 2014 05:55
Emacs起動時に package installするためのsnipet From http://qiita.com/catatsuy/items/5f1cd86e2522fd3384a0
(require 'cl)
(defvar installing-package-list
'(
;; ここに使っているパッケージを書く。
php-mode
magit
markdown-mode
yaml-mode
))