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/bash | |
folder=($(basename ${PWD%/*/*})) | |
cdate=($(date +"%Y%m%d-%H%M%S")) | |
cd ../../../ | |
zip -r "$folder"-"$cdate".zip $folder |
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
Design your API for developers first, they are the main users. In that respect, simplicity and intuitivity matter. | |
Use HTTP verbs instead of relying on parameters (e.g. ?action=create). HTTP verbs map nicely with CRUD: | |
POST for create, | |
GET for read, | |
DELETE for remove, | |
PUT for update (and PATCH too). | |
Use HTTP status codes, especially for errors (authentication required, error on the server side, incorrect parameters)... There are plenty to choose from, here are a few: | |
200: OK | |
201: Created |
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
// ---------------------------------------------------------------------------------------------------- | |
// - Display Errors | |
// ---------------------------------------------------------------------------------------------------- | |
ini_set('display_errors', 'On'); | |
ini_set('html_errors', 0); | |
// ---------------------------------------------------------------------------------------------------- | |
// - Error Reporting | |
// ---------------------------------------------------------------------------------------------------- | |
error_reporting(-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
/* Load more | |
========================================================================== */ | |
var loading = false; | |
// The number of the next page to load (/page/x/). | |
var pageNum = parseInt(jQuery('.load-more a').attr('data-page')) + 1; | |
// The maximum number of pages the current query can return. | |
var max = parseInt(jQuery('.load-more a').attr('data-pages')); | |
// The link of the next page of posts. | |
var nextLink = jQuery('.load-more a').attr('data-link'); | |
/** |