Javascript cloth simulation.
###How to use enable vi mode Here
Press prefix and '['. Ex: Ctrl B [
I use Ctrl A for prefix
###My recommend
After go to vi mode prefix [
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'mina/bundler' | |
require 'mina/rails' | |
require 'mina/git' | |
require 'mina/rvm' # for rvm support. (http://rvm.io) | |
set :domain, 'deploy@host' | |
set :repository, 'git... | |
set :branch, 'master' | |
set :shared_paths, ['config/database.yml', 'config/application.yml', 'log', 'tmp/sockets', 'tmp/pids'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ImportParticipant | |
def initialize(source:, :target) | |
@source = source | |
@target = target | |
end | |
attr_reader :source, :target | |
def call | |
data = @source.read_and_parse |
I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.
These are the steps I went through to set up an SSL cert.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'minitest/autorun' | |
class PianoKeyTest < Minitest::Test | |
KEYS_COUNT = 88 | |
BLACK_KEY_SEQ = [0, 2, 5, 7, 9] | |
BLACK_SEQ_START_POS = 5 | |
BLACK = "black" | |
WHITE = "white" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ -n "$ZSH_VERSION" ]; then | |
echo 'zsh env' | |
echo 'export COVERAGE=true' >> ~/.zshrc | |
elif [ -n "$BASH_VERSION" ]; then | |
echo 'bash env' | |
echo 'export COVERAGE=true' >> ~/.bashrc | |
else | |
echo 'You need to run `COVERAGE=true rspec` each time' | |
fi |
Rack is a common interface to interact with different ruby server
to understand the concept of http server, we just need to search for some ruby code that implement a tcp server without any library.
here is a potato for you
server = TCPServer.new('localhost', 12345)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'webrick' | |
class BlogApplication < WEBrick::HTTPServlet::AbstractServlet | |
class PostRepository | |
Post = Struct.new(:title, :content) | |
def self.get | |
[ | |
Post.new("post1", "content1"), | |
Post.new("post2", "content2") |
NewerOlder