based on DigitalOcean guide
Create local project
local$ rails new appname -T -d postgresql
local$ rails g scaffold Story title:string body:text
local$ rails db:migrate
based on DigitalOcean guide
Create local project
local$ rails new appname -T -d postgresql
local$ rails g scaffold Story title:string body:text
local$ rails db:migrate
# Source: https://stackoverflow.com/questions/8199231/how-to-setup-mass-dynamic-virtual-hosts-in-nginx | |
server { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
# Match any server name with the format [subdomain.[.subdomain...]].domain.tld.dev | |
server_name ~^(?<subdomain>([\w-]+\.)*)?(?<domain>[\w-]+\.[\w-]+)\.dev$; | |
# Map by default to (projects_root_path)/(domain.tld)/www; |
Internet connection and DNS routing are broken from WSL2 instances, when some VPNs are active. The workaround breaks down into two problems:
This problem is tracked in multiple microsoft/WSL issues including, but not limited to:
module MyApp | |
class Application < Rails::Application | |
if Rails.env == 'test' | |
require 'diagnostic' | |
config.middleware.use(MyApp::DiagnosticMiddleware) | |
end | |
end | |
end |
/*! | |
* jQuery JavaScript Library v1.7.2 | |
* http://jquery.com/ | |
* | |
* Copyright 2011, John Resig | |
* Dual licensed under the MIT or GPL Version 2 licenses. | |
* http://jquery.org/license | |
* | |
* Includes Sizzle.js | |
* http://sizzlejs.com/ |
class ApplicationControler < AC::Base | |
include FayeHelper | |
# ... existing code | |
before_filter { | |
return if current_user.nil? | |
if current_user.refresh_session_token | |
# make a new client with the new token | |
client = setup_faye_client |
Based on this blogpost.
Install with Homebrew:
$ brew install postgresql
Run server:
require 'fileutils' | |
# __FILE__ keyword in ruby | |
puts "The current ruby file being executed is #{__FILE__}" | |
# Gets the directory name of the file being executed | |
current_directory = File.dirname(__FILE__) | |
puts "The current directory is #{current_directory}" | |
# expands to reveal the pwd (Present working directory) |
Step by step how to pull a private DockerHub hosted image in a Kubernetes YML. | |
export DOCKER_REGISTRY_SERVER=https://index.docker.io/v1/ | |
export DOCKER_USER=Type your dockerhub username, same as when you `docker login` | |
export DOCKER_EMAIL=Type your dockerhub email, same as when you `docker login` | |
export DOCKER_PASSWORD=Type your dockerhub pw, same as when you `docker login` | |
kubectl create secret docker-registry myregistrykey \ | |
--docker-server=$DOCKER_REGISTRY_SERVER \ | |
--docker-username=$DOCKER_USER \ |
Remember that using vue jsx has some caveats. Most importantly that most vue builtin directives are not supported (for example, v-for
, v-model
, etc.), expect for v-show
. Some of them can be implemented manually, but v-model
for example is kind of a pain in the ass.
https://vuejs.org/v2/guide/render-function.html#Replacing-Template-Features-with-Plain-JavaScript
https://github.com/vuejs/babel-plugin-transform-vue-jsx#vue-directives
There's this though:
https://github.com/nickmessing/babel-plugin-jsx-v-model
Also the sourcemap result is kind of crappy, things like @
are not mapped correctly, I resorted to just using 'eval'
as webpack config.devtool
, it's good enough for what I'm doing.