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
putenv("ENV_VARIABLE=$value_for_env_variable"); |
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. homestead ssh | |
2. php -i | |
3. copy output and paste in https://xdebug.org/wizard.php | |
4. install Xdebug | |
5. Xdebug settings go in fpm/php.ini. Example: | |
[XDebug] | |
zend_extension="/usr/lib/php5/20131226/xdebug.so" | |
xdebug.remote_enable=true | |
xdebug.remote_port=9000 | |
xdebug.profiler_enable=1 |
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
function serverRespondGet(server, api, data){ | |
server.respondWith( "GET", api, [200, { | |
"Content-Type": "application/json", | |
"Access-Control-Allow-Headers":"Origin, X-Requested-With, Content-Type, Accept", | |
"Access-Control-Allow-Methods" : "POST, GET, PUT, DELETE, OPTIONS", | |
"Access-Control-Allow-Origin" : "*" | |
}, JSON.stringify(data)] | |
); | |
} |
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
NAME=$(git branch | grep '*' | sed 's/* //') | |
DESCRIPTION=$(git config branch."$NAME".description) | |
TEXT=$(cat "$1" | sed '/^#.*/d') | |
if [ -n "$TEXT" ] | |
then | |
echo "$NAME"': '$(cat "$1" | sed '/^#.*/d') > "$1" | |
if [ -n "$DESCRIPTION" ] | |
then | |
echo "" >> "$1" |
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
module.exports.views = { | |
engine: { | |
ext: 'njk', | |
fn: require("consolidate").nunjucks | |
}, | |
layout: 'layout', | |
partials: false | |
}; |
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
{% extends "react_template.njk" %} | |
{% block css %} | |
<link href="/temp/app/register.css" rel="stylesheet"> | |
{% endblock %} | |
{% block js %} | |
<script src="/temp/app/register.js"></script> | |
{% endblock %} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>React Template</title> | |
<!-- Viewport mobile tag for sensible mobile support --> | |
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> | |
<!-- Default CSS --> | |
<link rel="stylesheet" href="/css/libs/libs.min.css"> |
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 -U postgres | |
$ use mydb | |
$ COPY ( | |
select array_to_json(array_agg(row_to_json(t))) | |
from ( | |
select * | |
from my_table | |
) t | |
) | |
TO '/path/to/file/file.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
/root | |
/app | |
/packages | |
/pages | |
/home | |
/signup | |
/shared_components | |
/shared | |
/packages | |
/models |
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
/* | |
Redux State | |
Generic structure: | |
module: { | |
data: { | |
resource: { | |
byId: {}, | |
allIds: {}, | |
current: 0 |