Dump DB Script, run under command line:
pg_dump -U postgres -Fc db_name > dbbackup.dump
Notes:
if zsh: command not found: pg_dump
happened
add PATH="/Applications/Postgres.app/Contents/MacOS/bin:$PATH"
to ~/.bash_profile
Resources:
Dump DB Script, run under command line:
pg_dump -U postgres -Fc db_name > dbbackup.dump
Notes:
if zsh: command not found: pg_dump
happened
add PATH="/Applications/Postgres.app/Contents/MacOS/bin:$PATH"
to ~/.bash_profile
Resources:
This is a series blog post cover above three topics of GraphQL:
GraphQL is not a new thing, it already exist for a while, the reason I decide to investigate it is because Github released their GraphQL API alpha currently. We know Github has been a very good company for a long time, their RESTful API also becomes some kind of standard for developers, so it's pretty interesting to see what’s new they've been released.
To provide better shopping experience for Onefill users, we want to support as many shopping site as we can by injecting our JavaScript engine into those sites. However, some of them are using iframe which is outdated HTML tag to implement some forms like payment and signup. And due to security issue JavaScript can’t communicate with iframe unless it’s same domain or it’s your domain. So here is the approach we did to support iframe under iOS web view and so we can communicate with it.
import UIKit | |
import WebKit | |
class ViewController: UIViewController, WKUIDelegate, WKNavigationDelegate { | |
var webView: WKWebView! | |
override func loadView() { | |
let webConfiguration = WKWebViewConfiguration() | |
let contentController = WKUserContentController() | |
let js: String = "var h1s = document.querySelectorAll('h1'); for (var i = 0; i < h1s.length; i++) { h1s[i].style.color = 'red' };" |
import UIKit | |
import WebKit | |
class ViewController: UIViewController, WKUIDelegate, WKNavigationDelegate, WKScriptMessageHandler { | |
var webView: WKWebView! | |
override func loadView() { | |
let webConfiguration = WKWebViewConfiguration() | |
let contentController = WKUserContentController() | |
// Inject JavaScript which sending message to App |
This is a series blog post cover above three topics of GraphQL:
GraphQL is not a new thing, it already exist for a while, the reason I decide to investigate it is because Github released their GraphQL API alpha currently. We know Github has been a very good company for a long time, their RESTful API also becomes some kind of standard for developers, so it’s pretty interesting to see what’s new they’ve been released.
This is a series blog post cover above three topics of GraphQL:
GraphQL is not a new thing, it already exist for a while, the reason I decide to investigate it is because Github released their GraphQL API alpha currently. We know Github has been a very good company for a long time, their RESTful API also becomes some kind of standard for developers, so it’s pretty interesting to see what’s new they’ve been released.
defmodule Validator do | |
def validate_age(age) do | |
cond do | |
age < 18 -> "Under 18" | |
age < 21 -> "Under 21" | |
true -> "Adult" | |
end | |
end | |
end |