Skip to content

Instantly share code, notes, and snippets.

View amitkhare's full-sized avatar
🤔
Brainstorming

Amit Kumar Khare amitkhare

🤔
Brainstorming
View GitHub Profile
'use strict'
// Template version: 1.2.5
// see http://vuejs-templates.github.io/webpack for documentation.
const path = require('path')
module.exports = {
dev: {
// Paths
@amitkhare
amitkhare / Cloud9 Dark ace theme - Monokai Improved
Last active December 6, 2017 12:36
Cloud9 > Your Style sheet
.ace_gutter {
}
.ace_print-margin {
}
.ace_support{
@amitkhare
amitkhare / Apache server site configuration with SSL
Created December 9, 2017 16:46
$ /etc/apache2/sites-available/site.tld.conf
#### http://www.site.tld
<VirtualHost *:80>
ServerName site.tld
ServerAlias www.site.tld
DocumentRoot /var/www/site.tld/public
<Directory /var/www/site.tld>
Options Indexes FollowSymLinks MultiViews
<?php
header('Access-Control-Allow-Origin: *');
header("Access-Control-Allow-Credentials: true");
header('Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS');
header('Access-Control-Max-Age: 1000');
header('Access-Control-Allow-Headers: Origin, Content-Type, X-Auth-Token , Authorization');
// ##################################################
// Tutorial available at https://youtu.be/jzYvZkP_vUs
// ##################################################
// clock start time HH:MM:SS
var clockStartAt = "06:00:10";
//Count Up/ Down rate
var rate = -1;
RewriteEngine On
# Some hosts may require you to use the `RewriteBase` directive.
# If you need to use the `RewriteBase` directive, it should be the
# absolute physical path to the directory that contains this htaccess file.
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Headers "Content-Type"
Header set Access-Control-Allow-Methods "GET"
</IfModule>
<?php
// Application middleware
// e.g: $app->add(new \Slim\Csrf\Guard);
// A middleware for enabling CORS
$app->add(function ($req, $res, $next) {
$response = $next($req, $res);
return $response
// CORS middleware
app.use((req, res, next)=>{
res.header('Access-Control-Allow-Origin','*')
res.header('Access-Control-Allow-Credentials','true')
res.header('Access-Control-Allow-Headers','X-Requested-With, Origin, Content-Type, X-Auth-Token , Authorization')
if(req.method === "OPTIONS"){
res.header('Access-Control-Allow-Methods','GET, PUT, POST, PATCH, DELETE, OPTIONS')
return res.status(200).json({});
@amitkhare
amitkhare / gist:d1d606d4a6c29b041dafba357be559a8
Created January 27, 2018 09:57 — forked from adamstac/gist:7462202
Install and configure Sendmail on Ubuntu

Install and configure Sendmail on Ubuntu

This should help you get Sendmail installed with basic configuration on Ubuntu.

  1. If sendmail isn't installed, install it: sudo apt-get install sendmail
  2. Configure /etc/hosts file: nano /etc/hosts
  3. Make sure the line looks like this: 127.0.0.1 localhost yourhostname
  4. Run Sendmail's config and answer 'Y' to everything: sudo sendmailconfig
  5. Restart apache sudo service apache2 restart