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
// 1. npm i -D express http-proxy | |
// 2. add to config: "server: { path: 'dev_server' }" | |
const express = require('express') | |
const sysPath = require('path') | |
const http = require('http') | |
const httpProxy = require('http-proxy') | |
const apiProxy = httpProxy.createServer({ | |
target: 'http://localhost:3000' | |
}) |
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
# import pytest | |
# from server.api import create_app | |
# @pytest.fixture | |
# def client(): | |
# return create_app().test_client() | |
# import os | |
import pytest | |
import json |
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
cat /path/to/public_key | ssh root@yourdokkuinstance "sudo sshcommand acl-add dokku [description]" |
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
Show hidden characters
{ | |
"install-then-remove": "npm i -D babel-plugin-transform-class-properties babel-preset-es2015 babel-preset-react babel-preset-stage-2 babel-plugin-lodash", | |
"presets": [ | |
"react", | |
"es2015", | |
"stage-2" | |
], | |
"plugins": [ | |
"transform-class-properties", | |
"lodash" |
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
{ | |
"install-then-remove": "npm i -D babel-plugin-transform-class-properties babel-preset-es2015 babel-preset-stage-2", | |
"presets": [ | |
"es2015", | |
"stage-2" | |
], | |
"plugins": [ | |
"transform-class-properties" | |
] | |
} |
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
{ | |
"install-then-remove": "npm i -D eslint eslint-config-standard eslint-plugin-babel eslint-plugin-promise eslint-plugin-standard babel-eslint", | |
"extends": ["standard"], | |
"ecmaFeatures": { | |
"modules": true | |
}, | |
"env": { | |
"browser": true, | |
"es6": true, | |
"node": true |
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
{ | |
"install-then-remove": "npm i -D eslint eslint-config-standard eslint-config-standard-jsx eslint-config-standard-react eslint-plugin-babel eslint-plugin-promise eslint-plugin-react eslint-plugin-standard", | |
"extends": ["standard", "standard-react", "plugin:react/recommended"], | |
"env": { | |
"browser": true, | |
"es6": true | |
}, | |
"parser": "babel-eslint", | |
"plugins": [ | |
"react" |
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
psql -h <pg_host> -p <pg_port> -U <pg_user> <pg_db> -t -c "select 'drop table \"' || tablename || '\" cascade;' from pg_tables where schemaname='public'" | psql -h <pg_host> -p <pg_port> -U <pg_user> <pg_db> | |
// remember to have the password set in .pgpass file, host:port:db:user:pass |
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
1) Convert to PEM format | |
These files now need to be converted to the PEM format by executing these 2 commands from the terminal: | |
openssl pkcs12 -clcerts -nokeys -out apns-prod-cert.pem -in apns-prod-cert.p12 | |
openssl pkcs12 -nocerts -out apns-prod-key.pem -in apns-prod-key.p12 | |
You will be forced to set a PEM passphrase on the second command, so execute the following command to remove it: | |
openssl rsa -in apns-prod-key.pem -out apns-prod-key-noenc.pem |
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
// ***note*** this is ARC enabled code | |
// DLog will output like NSLog only when the DEBUG variable is set | |
// ALog will always output like NSLog | |
// ULog will show the UIAlertView only when the DEBUG variable is set | |
#define ALog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); | |
#ifdef DEBUG | |
# define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); |
NewerOlder