Skip to content

Instantly share code, notes, and snippets.

View MarouaneSH's full-sized avatar
🏠
Working from home

Marouane Souah MarouaneSH

🏠
Working from home
View GitHub Profile
@MarouaneSH
MarouaneSH / javascript Datediff for human
Created June 12, 2018 13:26
Javascript Datediff for human ( CARBON DATEDIFF)
function timeSince(date) {
var seconds = Math.floor((new Date() - date) / 1000);
var interval = Math.floor(seconds / 31536000);
if (interval > 1) {
return interval + " years";
}
interval = Math.floor(seconds / 2592000);
@Christilut
Christilut / VCurrencyField.vue
Created June 7, 2018 18:14
Vuetify Currency Field
<template lang="pug">
v-text-field(
ref='field',
:prefix='prefix',
v-model='model',
@focus='onFocus',
@keyup='onKeyUp',
:error-messages='errorMessages',
v-bind='$attrs',
@change='onChange'
@sharathchandramg
sharathchandramg / install-comodo-ssl-cert-for-nginx.md
Last active August 17, 2023 13:17
Steps to install a Comodo Wildcard certificate with Nginx.

The steps below show how to install comodo certificate on centos7.

I have used bigrock.in for the domain registration and procuring the certificates

Create a certificate request

  1. Create a folder to put all our ssl certificates

     mkdir /etc/nginx/ssl/c2r_com
    

cd /etc/nginx/ssl/c2r_com

@YagoLopez
YagoLopez / deep-search-javascript-object.js
Last active January 8, 2023 10:02
Deep search javascript object
/* Attribution: http://techslides.com/how-to-parse-and-search-json-in-javascript */
//return an array of objects according to key, value, or key and value matching
function getObjects(obj, key, val) {
var objects = [];
for (var i in obj) {
if (!obj.hasOwnProperty(i)) continue;
if (typeof obj[i] == 'object') {
objects = objects.concat(getObjects(obj[i], key, val));
} else
@nasrulhazim
nasrulhazim / AppServiceProvider.php
Last active October 1, 2023 15:47
Laravel Base64 and Base64 Image Validator
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
@mcraz
mcraz / Time Since JS
Created April 27, 2014 16:13
Get time difference in human readable format
function timeSince(date) {
var seconds = Math.floor((new Date() - date) / 1000);
var interval = Math.floor(seconds / 31536000);
if (interval > 1) {
return interval + " years";
}
interval = Math.floor(seconds / 2592000);
@bradmontgomery
bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active June 10, 2024 15:37
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert