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
// For adding custom messages if using blueprint | |
// In reponses/badrequest.js | |
// after | |
// if (sails.config.environment === 'production') { | |
// data = undefined; | |
// } | |
// add | |
if (data.invalidAttributes !== undefined) { | |
var attributes = data.invalidAttributes; |
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
//in api/models/User.js | |
function validationError(invalidAttributes, status, message) { | |
var WLValidationError = require('../../node_modules/sails/node_modules/waterline/lib/waterline/error/WLValidationError.js'); | |
return new WLValidationError({ | |
invalidAttributes: invalidAttributes, | |
status: status, | |
message: message | |
} | |
); | |
} |
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
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: mailcatcher | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Example initscript | |
# Description: This file should be used to construct scripts to be | |
# placed in /etc/init.d. |
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
#!/usr/bin/env bash | |
set -e | |
mkdir -p /root/tmp | |
#migrate "original db params" "new db params" "new db name" | |
function migrate(){ | |
mysqldump --skip-lock-tables --single-transaction --add-drop-table $1 > /root/tmp/${3}.sql |
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
--- | |
- include_vars: secrets.yml | |
- apt: pkg={{ item }} state=present update_cache=yes | |
with_items: | |
- build-essential | |
- mime-support | |
- libfuse-dev | |
- libcurl4-openssl-dev |
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
<?php | |
namespace App\Entity; | |
abstract class BaseEntity | |
{ | |
public function toArray() | |
{ | |
$properties['__type'] = get_class($this); | |
$properties += get_object_vars($this); |
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
<VirtualHost *:80> | |
ProxyPreserveHost On | |
ServerName proxy-test.example.com | |
FilterDeclare MYFILTER | |
FilterProvider MYFILTER SUBSTITUTE resp=Content-Type $text/ | |
FilterProvider MYFILTER SUBSTITUTE resp=Content-Type $/xml | |
FilterProvider MYFILTER SUBSTITUTE resp=Content-Type $/json | |
FilterProvider MYFILTER SUBSTITUTE resp=Content-Type $/javascript | |
<Location /> | |
#disable gzip |
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
package main | |
import ( | |
"gopkg.in/mgo.v2" | |
"gopkg.in/mgo.v2/bson" | |
"fmt" | |
"strconv" | |
"time" | |
"sync" | |
) |
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
SELECT to_char('2018-02-28 18:48:11.196+00'::timestamp, 'YYYY-MM-DD"T"HH24:MI:SSZ') |
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
#!/usr/bin/env bash | |
####Usage | |
# ./vault.sh encrypt | |
# ./vault.sh dencrypt | |
# ./vault.sh encrypt /full/path/to/file.yml | |
###### | |
set -euo pipefail |
OlderNewer