This file contains hidden or 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
| // here's a handy trick: | |
| /* | |
| console.log('any code') | |
| /**/ | |
| // It takes just one character change |
This file contains hidden or 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 node | |
| // I am ./bin/buildSitemap.js | |
| const path = require('path') | |
| const glob = require('glob') | |
| const fs = require('fs') | |
| const SITE_ROOT = process.env.SITE_ROOT || 'https://www.actionherojs.com' | |
| const SOURCE = process.env.SOURCE || path.join(__dirname, '..', 'pages', '/**/*.js') | |
| const DESTINATION = process.env.DESTINATION || path.join(__dirname, '..', 'static', 'sitemap.xml') |
This file contains hidden or 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
| local _M = { | |
| _VERSION = '0.1' | |
| } | |
| local connect = function() | |
| local redis = require "resty.redis" | |
| local red = redis:new() | |
| red:set_timeout(1000) -- 1 sec | |
| local ok, err = red:connect("127.0.0.1", 6379) | |
| if not ok then |