この前のブログ記事見た人はごめん。
どこが間違ってるか分かります?
| #include <iostream> | |
| #include <type_traits> | |
| #include <vector> | |
| extern void* enabler; | |
| template<typename T> | |
| constexpr auto has_begin(T* p) -> decltype((p->begin(), true)) | |
| { |
| #!/bin/sh | |
| if [ -z "$1" ]; then | |
| echo Usage: $0 {config-file} | |
| exit | |
| fi | |
| vim -N -u NONE -i NONE -V1 -e -s --cmd "source $1" --cmd NeoBundleInstall! --cmd qall! |
| #!/bin/sh | |
| NAME="Unicorn" | |
| ENV=production | |
| ROOT_DIR="/var/www/rails/rails_app" | |
| PID="${ROOT_DIR}/tmp/pids/unicorn.pid" | |
| CONF="${ROOT_DIR}/config/unicorn.rb" | |
| OPTIONS="--path /rails_app" |
| require 'capistrano/git' | |
| class Capistrano::Git | |
| module SubDirectoryStrategy | |
| include DefaultStrategy | |
| def release | |
| git :archive, fetch(:branch), fetch(:project_root), '| tar -x -C', release_path, "--strip=#{fetch(:project_root).count('/')+1}" | |
| end | |
| end |
この前のブログ記事見た人はごめん。
どこが間違ってるか分かります?
This template is supposed to be applied to rails 5.
run with:
rails new <application_name> --template=https://gist.githubusercontent.com/karloku/edd6a158e275fdefa334/raw/b56175bee5b45d32310aeb620e23be44e3c2a56d/graphql_template.rb -Tusing gems:
| # yes, sometimes you need to do this. you get pilloried in a forum if you | |
| # ask about it, though! | |
| # this code taken from | |
| # http://wholemeal.co.nz/blog/2011/04/05/rendering-from-a-model-in-rails-3/ | |
| class MyModel < ActiveRecord::Base | |
| # Use the my_models/_my_model.txt.erb view to render this object as a string | |
| def to_s | |
| ActionView::Base.new(Rails.configuration.paths.app.views.first).render( |
| 前提 | |
| ----------- | |
| - docker 0.9.1 | |
| - lxcを入れること | |
| - linux 3.11で確認。 3.8以上じゃないとだめっぽい。 | |
| - ubuntu image (docker pull ubuntuで取ってきたもので試してみた) | |
| - imageにはpython2を入れておくこと | |
| - /usr/bin/tee がimageにあること |
| /* @flow */ | |
| import SHA256 from 'crypto-js/sha256' | |
| type Block = { | |
| index: number, | |
| previousHash: string, | |
| timestamp: number, | |
| data: string, | |
| hash: string | |
| } |
Ruby のコードを読んでいると
class Hoge
class << self
def hello
puts 'hello'
end
end
end