adduser houseuser passwd houseuser su - postgres CREATEUSER -P houseuser # WITH PASSWORD 'house1208fasd' createdb house_prod psql GRANT ALL PRIVILEGES ON DATABASE house_prod to houseuser
/etc/init.d/postgresql start 9.6
adduser houseuser passwd houseuser su - postgres CREATEUSER -P houseuser # WITH PASSWORD 'house1208fasd' createdb house_prod psql GRANT ALL PRIVILEGES ON DATABASE house_prod to houseuser
/etc/init.d/postgresql start 9.6
``` | |
方法一:使用淘宝镜像 | |
直接运行下面的命令即可: | |
SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/ npm install node-sass | |
我们可能更希望能直接使用 npm install 安装所有依赖,所以我的做法是在项目内添加一个 .npmrc 文件: | |
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/ | |
phantomjs_cdnurl=https://npm.taobao.org/mirrors/phantomjs/ |
```ruby | |
# remove attr and replace node | |
doc = Nokogiri::HTML::DocumentFragment.parse(self.description) | |
imgs = doc.search("img") | |
imgs.each do |img| | |
style = img.attr("style") | |
puts style.inspect | |
img.replace("<amp-img height='100' width='610' layout='responsive' src='#{img.attr("src")}' ></amp-img>") | |
end | |
doc.css('*').remove_attr('style') |
# Query with preload and join | |
```elixir | |
q = from l in List, | |
join: ul in UserList, | |
where: ul.user_id == ^current_user.id and l.id == ul.list_id, | |
order_by: [desc: l.done_at, asc: l.id] | |
lists = q |> preload(:user) |> Repo.all | |
``` |
ref:
add deps {:distillery, "~> 1.0"}
mix deps.get
mix release.init
%Plug.Conn{ | |
adapter: {Plug.Adapters.Cowboy.Conn, :...}, | |
assigns: %{ | |
my_assigns: "here" | |
}, | |
before_send: [ | |
#Function<7.125546534/1 in Phoenix.Controller.fetch_flash/2>, | |
#Function<1.127904613/1 in Plug.Session.before_send/2>, | |
#Function<1.43511252/1 in Plug.Logger.call/2>, | |
#Function<0.70322810/1 in Phoenix.LiveReloader.before_send_inject_reloader/1> |
%Plug.Conn{ | |
adapter: {Plug.Adapters.Cowboy.Conn, :...}, | |
assigns: %{ | |
my_assigns: "here" | |
}, | |
before_send: [ | |
#Function<7.125546534/1 in Phoenix.Controller.fetch_flash/2>, | |
#Function<1.127904613/1 in Plug.Session.before_send/2>, | |
#Function<1.43511252/1 in Plug.Logger.call/2>, | |
#Function<0.70322810/1 in Phoenix.LiveReloader.before_send_inject_reloader/1> |
local function keyCode(key, modifiers) | |
modifiers = modifiers or {} | |
return function() | |
hs.eventtap.event.newKeyEvent(modifiers, string.lower(key), true):post() | |
hs.timer.usleep(1000) | |
hs.eventtap.event.newKeyEvent(modifiers, string.lower(key), false):post() | |
end | |
end |
/* | |
gfw_whitelist.pac | |
GFW Whitelist | |
- inspired by autoproxy and chnroutes | |
v1.2 | |
Author: [email protected] | |
License: MIT License |
require 'socket' | |
require 'uri' | |
# Usage: | |
## => EmbedServer.new(web_root).run | |
class EmbedServer | |
attr_accessor :web_root, :port | |
def initialize(web_root, options = {}) |