Skip to content

Instantly share code, notes, and snippets.

View phpfour's full-sized avatar

Mohammad Emran phpfour

View GitHub Profile
# SETUP #
DOMAIN=example.com
PROJECT_REPO="[email protected]:example.com/app.git"
AMOUNT_KEEP_RELEASES=5
RELEASE_NAME=$(date +%s--%Y_%m_%d--%H_%M_%S)
RELEASES_DIRECTORY=~/$DOMAIN/releases
DEPLOYMENT_DIRECTORY=$RELEASES_DIRECTORY/$RELEASE_NAME
# stop script on error signal (-e) and undefined variables (-u)
@mayneyao
mayneyao / notion2blog.js
Last active June 7, 2025 05:54
Notion.so > Personal Blog | custom domain + disqus comment
const MY_DOMAIN = "agodrich.com"
const START_PAGE = "https://www.notion.so/gatsby-starter-notion-2c5e3d685aa341088d4cd8daca52fcc2"
const DISQUS_SHORTNAME = "agodrich"
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
@WebDevEtc
WebDevEtc / script.php
Created September 29, 2018 15:13
Change Laravel User Password in php artisan tinker
<?
// run this in php artisan tinker (enter it line by line) to chage the pw
// select whatever user you want to edit.
$user = \App\User::where('id', 1)->firstOrFail();
$user->password = Hash::make('Your New Password');
$user->save();
@florentdestremau
florentdestremau / NewPasswordType.php
Last active January 5, 2025 11:57
A simple User authentication setup to copy & paste into your Symfony 3.4 install
<?php
namespace AppBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\FormBuilderInterface;
@hoandang
hoandang / php-docker-ext
Created May 20, 2017 01:12
Complete list of php docker ext
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN docker-php-ext-install mcrypt
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
version: '3'
services:
redis:
image: redis
container_name: redis
postgres:
image: 'postgres'
container_name: postgres
@martensonbj
martensonbj / readme-template.md
Created February 16, 2017 19:21
Personal project README template

Project Name & Pitch

Example:

TweetWorld

An application used to filter data form Twitter based on user preference, built with React, Redux, JavaScript, and CSS.

Project Status

(only necessary if incomplete)

@woutsanders
woutsanders / MenuBuilder.php
Last active February 15, 2020 08:46
Knp Menu Bundle with the Metronic Admin Theme 4 sidebar menu http://bit.ly/2bfd2JS Couldn't have done it without this earlier, successful, attempt for Twitter Bootstrap: https://gist.github.com/nateevans/9958390. Rendered example: http://imgur.com/a/9LfZq If you are going to use this, make sure you have a valid license for the template!
<?php
namespace AppBundle\Menu;
use Knp\Menu\FactoryInterface;
/* Please note, this is a test with made up items */
class MenuBuilder {
private $factory;
@w00fz
w00fz / sphp.sh
Last active November 28, 2024 12:37
PHP switcher
#!/bin/bash
# Check if command was ran as root.
if [[ $(id -u) -eq 0 ]]; then
echo "The command \"sphp\" should not be executed as root or via sudo directly."
echo "When a service requires root access, you will be prompted for a password as needed."
exit 1
fi
# Usage
@niksumeiko
niksumeiko / disable-html-form-input-autocomplete-autofill.md
Last active May 9, 2025 14:55
Disable HTML form input autocomplete and autofill

Disable HTML Form Input Autocomplete and Autofill

  1. Add autocomplete="off" onto <form> element;
  2. Add hidden <input> with autocomplete="false" as a first children element of the form.
<form autocomplete="off" method="post" action="">
    <input autocomplete="false" name="hidden" type="text" style="display:none;">
    ...