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 = { | |
get: function (req, res) { | |
res.sendfile(req.path.substr(1)); | |
}, | |
_config: { | |
rest: false, | |
shortcuts: 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
// example.js | |
// =============================== | |
// | |
// Client-side (browser) example of how you might connect a socket.io client | |
// to your Sails backend. | |
// For the latest docs on talking to Sails via socket.io, check out the new reference section in the Sails docs: | |
// https://github.com/balderdashy/sails-docs/blob/master/reference/SocketClient.md | |
// As for some great tutorials, my best recommendation would be to check out @irlnathan's sailscasts: |
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
-- Schema: public | |
DROP SCHEMA public CASCADE; | |
DROP SCHEMA retail CASCADE; | |
DROP SCHEMA logs CASCADE; | |
CREATE SCHEMA public; | |
GRANT ALL ON SCHEMA public TO postgres; | |
GRANT ALL ON SCHEMA public TO public; | |
COMMENT ON SCHEMA public |
This is a rough guide to automating a nightly 7-day rolling remote backup of your PostgreSQL database(s) for your dokku app(s). There is a slight difference if you are using an older version of Dokku.
This will save the comprssed output of pg_dump
as well as the contents
of the /home
directory on your dokku machine (just in case).
You will need to create a shell script in /root
and edit the cron file.
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
# | |
# Makefile to perform "live code reloading" after changes to .go files. | |
# | |
# n.b. you must install fswatch (OS X: `brew install fswatch`) | |
# | |
# To start live reloading run the following command: | |
# $ make serve | |
# | |
# binary name to kill/restart |
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 ( | |
"net/http" | |
"github.com/labstack/echo" | |
"github.com/labstack/echo/engine/fasthttp" | |
) | |
func main() { |
made with esnextbin
- Text Content Generator - http://www.lipsum.com
- Favicon Generator - http://tools.dynamicdrive.com/favicon
- Data Generator - https://mockaroo.com/
- Mobile Mockup Generator - https://mockuphone.com
- Logo Generator - https://www.logaster.com
- UUID Generator - https://www.uuidgenerator.net/
- Hash Generator - https://passwordsgenerator.net/sha256-hash-generator/
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
/** round n down to nearest multiple of m */ | |
long roundDown(long n, long m) { | |
return n >= 0 ? (n / m) * m : ((n - m + 1) / m) * m; | |
} | |
/** round n up to nearest multiple of m */ | |
long roundUp(long n, long m) { | |
return n >= 0 ? ((n + m - 1) / m) * m : (n / m) * m; | |
} |
OlderNewer