Skip to content

Instantly share code, notes, and snippets.

View ilearnbydoing's full-sized avatar

Durgesh Gupta ilearnbydoing

View GitHub Profile
{{root}}
{{nginx_access_log}}
{{nginx_error_log}}
if ($scheme != "https") {
rewrite ^ https://$host$uri permanent;
}
location ~ /.well-known {
@wmandai
wmandai / AppServiceProvider.php
Created June 23, 2021 21:21 — forked from greenspace10/AppServiceProvider.php
Laravel, Livewire, Alpine JS Toast Notifications
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Component::macro('notify', function ($message, $title = '', $type = 'success') {
$this->dispatchBrowserEvent('notify', ['message' => $message, 'title' => $title, 'type' => $type]);
});
@ilearnbydoing
ilearnbydoing / Coffee.js
Created April 27, 2021 01:17 — forked from agneym/Coffee.js
Buy me a Coffee with React and Styled Components
import React from 'react';
import styled from 'styled-components';
const Button = styled.a`
line-height: 2;
height: 5rem;
text-decoration: none;
display:inline-flex;
color: #FFFFFF;
background-color: #FF813F;
@mhsamiei
mhsamiei / gonicorn_nginx_django.md
Last active January 11, 2025 05:10
deploy django with nginx and gunicorn config

Testing Gunicorn’s Ability to Serve the Project The last thing we want to do before leaving our virtual environment is test Gunicorn to make sure that it can serve the application. We can do this by entering our project directory and using gunicorn to load the project’s WSGI module:

    (myenv) $ cd ~/myprojectdir
    (myenv) $ gunicorn --bind 0.0.0.0:8000 myproject.wsgi

Creating systemd Socket and Service Files for Gunicorn We have tested that Gunicorn can interact with our Django application, but we should implement a more robust way of starting and stopping the application server. To accomplish this, we’ll make systemd service and socket files.

@lineharo
lineharo / gist:be84e6a9309c035ec79c4219adc36966
Created April 25, 2020 18:49
Install VestaCP(nginx+apache, vsftpd, exim+devocot, DNS named, MySQL) + PHP-7.4 on Ubuntu 18.04 LTS
sudo apt-get update
sudo apt-get install -y vim git curl wget unzip zip gcc build-essential make
sudo apt-get install software-properties-common
curl -O http://vestacp.com/pub/vst-install.sh
bash vst-install.sh --nginx yes --apache yes --phpfpm no --named yes --remi yes --vsftpd yes --proftpd no --iptables yes --fail2ban yes --quota no --exim yes --dovecot yes --spamassassin no --clamav no --softaculous no --mysql yes --postgresql no
@gopalkildoliya
gopalkildoliya / Account.vue
Created October 21, 2019 10:51
VueJs Component for Paddle
<template>
<div>
<div class="content has-text-centered" v-if="user">
<button @click="subscribe">Checkout</button>
</div>
</div>
</template>
<script
import {db, firebase} from "../db";
@kreativan
kreativan / dropzone.php
Last active November 9, 2024 10:51
Upload files with dropzone.js and php
<?php
// process $_POST request
if(isset($_POST["submitDropzone"])) {
// Do something
print_r($_POST);
}
?>
@escopecz
escopecz / form.html
Last active April 23, 2024 17:29
An example of how to send a form submission to a Mautic form with jQuery
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Mautic Form Test</title>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
@berkedel
berkedel / flow-error-icu4c-not-loaded.md
Created April 4, 2018 14:13
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.60.dylib

How to solve dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.60.dylib

brew uninstall --ignore-dependencies node icu4c
brew install node
@peterbrinck
peterbrinck / Laravel on VestaCP.md
Last active July 2, 2023 14:49
Laravel web templates for VestaCP

I'm not using this or VestaCP anymore, so I can't confirm if still working or not.

I've made a new web template to make Laravel work easily on VestaCP, and so I wouldn't have to change my Laravel installation, if I ever wanted to deploy it elsewhere.

Each file should be put in /usr/local/vesta/data/templates/web/apache2

Then, when you edit your domain/site, you can change the web template to Laravel and just upload your whole project into public_html