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
// server.js | |
const express = require('express'); | |
const app = express(); | |
const port = 8080; | |
// Define a route | |
app.get('/', (req, res) => { | |
res.send('Hello, World!'); | |
}); |
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
{ | |
"workbench.iconTheme": "vscode-icons", | |
"workbench.colorTheme": "Noctis Minimus", | |
"editor.wordWrap": "on", | |
"editor.fontLigatures": true, | |
"editor.fontSize": 15, | |
"editor.fontWeight": "400", // Regular, | |
"editor.tabSize": 2, | |
"editor.letterSpacing": 0.5, | |
"editor.cursorStyle": "line", |
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
require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | |
/*! | |
* Copyright 2016 Yahoo Inc. | |
* Licensed under the terms of the MIT license. Please see LICENSE file in the project root for terms. | |
* @license | |
*/ | |
var merge = require('merge'); | |
/** |
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
/* eslint-disable no-restricted-globals */ | |
// This service worker can be customized! | |
// See https://developers.google.com/web/tools/workbox/modules | |
// for the list of available Workbox modules, or add any other | |
// code you'd like. | |
// You can also remove this file if you'd prefer not to use a | |
// service worker, and the Workbox build step will be skipped. | |
import { clientsClaim } from 'workbox-core'; |
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
const aws = require('aws-sdk'); | |
require('dotenv').config(); | |
const s3 = new aws.S3({ | |
signatureVersion: process.env.S3_SIGNATURE_VERSION, | |
region: process.env.S3_REGION | |
}); | |
const params = { |
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
/** | |
* Merge Search fields to form a query. | |
* @param {Array, String} | |
* @returns {Object} | |
*/ | |
export function merge_searchable_fields(searchable_fields, q) { | |
let query = {}; |
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
#!/bin/bash | |
yum install httpd php php-mysql -y | |
cd /var/www/html | |
wget https://wordpress.org/latest.tar.gz | |
tar -xzf latest.tar.gz | |
cp -r wordpress/* /var/www/html/ | |
rm -rf wordpress | |
rm -rf latest.tar.gz | |
chmod -R 755 wp-content | |
chown -R apache:apache wp-content |
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
/** | |
* Pagination settings. | |
* | |
* @param {Object} pagination: {page, limit} | |
* @returns {Object} | |
*/ | |
export function paginate(pagination) { | |
const { page = 1, limit = 10 } = pagination; | |
const offset = (page - 1) * limit; |
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
{ | |
"editor.formatOnSave": true, | |
"editor.defaultFormatter": "esbenp.prettier-vscode", | |
"workbench.colorTheme": "Shades of Purple", | |
"editor.wordWrap": "on", | |
"editor.fontLigatures": true, | |
"editor.fontSize": 15, | |
"editor.fontWeight": "400", // Regular, | |
"editor.tabSize": 2, | |
"editor.letterSpacing": 0.5, |
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
require "active_record" | |
namespace :db do | |
db_config = YAML::load(File.open('config/database.yml')) | |
db_config_admin = db_config.merge({'database' => 'postgres', 'schema_search_path' => 'public'}) | |
desc "Create the database" | |
task :create do | |
ActiveRecord::Base.establish_connection(db_config_admin) |