type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
| # Create a fork and workout the solution. do not capture solution here | |
| def find_embedded_word(arr, random_string) | |
| arr.detect do |word| | |
| return word if random_string.include?(word) | |
| random_substring = random_string.scan(/[#{word}]/).join('') | |
| word.split('').all? { |letter| random_substring.slice!(letter) } | |
| end |
type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
| # | |
| # CORS header support | |
| # | |
| # One way to use this is by placing it into a file called "cors_support" | |
| # under your Nginx configuration directory and placing the following | |
| # statement inside your **location** block(s): | |
| # | |
| # include cors_support; | |
| # | |
| # As of Nginx 1.7.5, add_header supports an "always" parameter which |
| ref: http://nathanhoad.net/deploy-from-a-git-tag-with-capistrano | |
| Deploy from a Git tag with Capistrano | |
| Are you using Capistrano and Git and want to easily deploy from Git tags? It couldn't be simpler | |
| Using Git, tag a new release: | |
| git tag -a 09.10.02.01 -m "Tagging a release" | |
| You can use git tag to list your tags: |
| # Add below into config/application.rb: | |
| # | |
| # config.middleware.use 'RequestLogger' | |
| # | |
| class RequestLogger | |
| def initialize app | |
| @app = app | |
| end | |
| def call(env) |
| #!/bin/env ruby | |
| # lazy hack from Robert Klemme | |
| module Memory | |
| # sizes are guessed, I was too lazy to look | |
| # them up and then they are also platform | |
| # dependent | |
| REF_SIZE = 4 # ? | |
| OBJ_OVERHEAD = 4 # ? |
| AllCops: | |
| RunRailsCops: true | |
| # Commonly used screens these days easily fit more than 80 characters. | |
| Metrics/LineLength: | |
| Max: 120 | |
| # Too short methods lead to extraction of single-use methods, which can make | |
| # the code easier to read (by naming things), but can also clutter the class | |
| Metrics/MethodLength: |
| $.ajax({ | |
| type: 'POST', | |
| url: "https://sandbox-api.didww.com/v3/orders", | |
| data: JSON.stringify({ | |
| data: { | |
| type: "orders", | |
| attributes: { | |
| allow_back_ordering: false, | |
| items: [{ | |
| type: "did_order_items", |
There are two main modes to run the Let's Encrypt client (called Certbot):
Webroot is better because it doesn't need to replace Nginx (to bind to port 80).
In the following, we're setting up mydomain.com.
HTML is served from /var/www/mydomain, and challenges are served from /var/www/letsencrypt.
| .popover.topLeft { | |
| margin-top: -10px; | |
| } | |
| .popover.topLeft .arrow { | |
| bottom: -11px; | |
| left: 20%; | |
| margin-left: -11px; | |
| border-top-color: #999999; | |
| border-top-color: rgba(0, 0, 0, 0.25); |