Skip to content

Instantly share code, notes, and snippets.

Avatar

Joan Boixadós mezod

View GitHub Profile
View gist:92312b1cae2d69aa6dbc2b3d013f888b
{
// ----------------------------------------------------------------------
// Debug Mode
// ----------------------------------------------------------------------
//
// @param {bool} "debug"
// @default false
//
// When enabled (true), additional debugging information about the command
// and configured settings will be printed to the Sublime Text Console;
View gist:5716de4b023f50e4d7a1fa43a5e3178b
{
"parser": "babel-eslint",
"parserOptions": {
"ecmaFeatures": {
"jsx": true,
"ecmaVersion": 8,
"experimentalObjectRestSpread": true
}
},
"rules": {
View gist:baa28f1f7275e5807226ac2c4aa5ed32
{
"Location": "https://cloudfront.amazonaws.com/2017-10-30/distribution/distro_id/invalidation/invalidation_id",
"Invalidation": {
"Id": "invalidation_id",
"Status": "InProgress",
"CreateTime": "2018-07-14T23:33:51.427Z",
"InvalidationBatch": {
"Paths": {
"Quantity": 2,
"Items": [
View dates.js
* get(params, user_id) {
const query = knex
.select(['habits.*',
'dates.created_at as dates_created_at', 'dates.date', 'dates.skip'])
.where({ user_id })
.orderBy('position', 'ASC')
.from('habits');
if (params.stats) {
query.leftJoin('dates', 'habits.id', '=', 'dates.habit_id');
View journal
Mar 15 23:48:22 ns399575.ip-5-196-67.eu systemd[1]: Stopped Caddy HTTP/2 web server.
-- Subject: Unit caddy.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit caddy.service has finished shutting down.
Mar 15 23:48:22 ns399575.ip-5-196-67.eu systemd[1]: caddy.service: Start request repeated too quickly.
Mar 15 23:48:22 ns399575.ip-5-196-67.eu systemd[1]: Failed to start Caddy HTTP/2 web server.
-- Subject: Unit caddy.service has failed
-- Defined-By: systemd
View config caddy
eventradr.com {
proxy / localhost:8080
## log /var/log/caddy/eventradr-com-caddy-access.log
## errors /var/log/caddy/eventradr-com-caddy-errors.log
tls mezood@gmail.com
}
eventradr.com:3000 {
proxy / localhost:3000
## log /var/log/caddy/api-eventradr-com-caddy-access.log
View node-http-proxy
var http = require('http'),
httpProxy = require('http-proxy');
var proxy = httpProxy.createProxyServer({});
var server = http.createServer(function(req, res) {
var host = req.headers.host;
var url;
console.log(host);
View gist:ddc3c29be764e44f79f11c7da00d3b9a
knex('events').select()
.where(knex.raw('events.user_id = users.id'))
.sum('upvotes')
.as('numupvotes')
.count()
.as('numevents')
You can’t perform that action at this time.