Skip to content

Instantly share code, notes, and snippets.

@mlakkadshaw
mlakkadshaw / index.html
Created December 30, 2022 22:21
tailwind.css chat ui
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Firebase Chat</title>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>
var http = require( 'http' );
module.exports.bootstrap = function(cb) {
//If the environment is production, then listen on port 80
if(sails.config.environment === "production") {
http.createServer( sails.hooks.http.app ).listen( 80 );
}
cb();
}
module.exports = function(req, res, next) {
if (req.secure) {
// Already https; don't do anything special.
next();
} else {
// Redirect to https.
res.redirect('https://' + req.headers.host + req.url);
}
};
module.exports = {
ssl: {
ca: require('fs').readFileSync(__dirname + '/ssl/ca.crt'),
key: require('fs').readFileSync(__dirname + '/ssl/key.key'),
cert: require('fs').readFileSync(__dirname + '/ssl/cert.crt')
},
port: 443,
policies: {
'*': 'isHTTPS'
}
module.exports = {
ssl: {
ca: require('fs').readFileSync(__dirname + '/ssl/ca.crt'),
key: require('fs').readFileSync(__dirname + '/ssl/key.key'),
cert: require('fs').readFileSync(__dirname + '/ssl/cert.crt')
},
port: 443
}
@mlakkadshaw
mlakkadshaw / setup.sh
Last active December 25, 2015 12:28
Setup automatic deployment on your server using this shell script. After this shell script is executed you can deploy code using "git push server master"
#!/bin/bash
# A bash script to setup GIT like deployment on your server
echo "Enter your server address e.g 25.32.132.1 or yourserver.com"
read serverAddress
echo "Enter Username which you use to login to your server e.g ubuntu"
read username
echo "Enter path of the private key (optional)"
read privateKeyPath
echo "Path of your server directory where code should reside: e.g ~/code or /var/www (required)"
read tempPath
@mlakkadshaw
mlakkadshaw / install_sentry.sh
Created October 1, 2015 11:51 — forked from bjmc/install_sentry.sh
Basic setup script for installing Sentry (http://getsentry.com) + Redis on new Ubuntu 14.04 Amazon EC2 instance
#! /bin/bash
export RUN_AS='sentry';
export INSTALL_DIR='/var/www/sentry';
HOSTNAME='http://mysentry.example.com'; # No trailing slash
DB_HOST='something.rds.amazonaws.com';
DB_PORT='5432';
DB_USER='sentry';
DB_NAME='sentry';
DB_PASSWORD='DB_PASSWORD';
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.mqtt = f()}})(function(){var define,module,exports;return (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){
(function (process,global){
'use strict';
/**
* Module dependencies
*/
/*global setImmediate:true*/
var events = require('events'),
Store = require('./store'),
eos = require
collaborativeLearningApp.service('screenShare', function($q, mainService) {
var $scope = undefined;
var that = this;
this.socket = mainService.socket;
this.getScope = function(s, room) {
$scope = s;
that.loadCount = 0;
var countx = 0,
county = 0;
Environment:
Request Method: GET
Request URL: http://localhost:8000/me/
Django Version: 1.7b4
Python Version: 2.7.5
Installed Applications:
('django.contrib.admin',