Skip to content

Instantly share code, notes, and snippets.

@leihuagh
leihuagh / SetupManimVenv.md
Created August 4, 2020 01:29
Setup virtual env for Manim

Setup Manim Virtual Environment

Create Project Location

cd \
cd projects/<path-to-place>
mkdir myanimations
cd myanimations
@leihuagh
leihuagh / first_last_name_validation.txt
Created May 2, 2020 21:35
laravel first name last validation
'first_name' => ['required', 'string', 'regex:/^[A-Z][a-z]*$/', 'min:3', 'max:25'],
'last_name' => ['required', 'string', 'regex:/^[A-z][A-z\s\.\']+$/', 'min:3', 'max:25'],
@leihuagh
leihuagh / mailsetting.txt
Created February 27, 2020 17:29
PHP mail setting
; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = root@localhost
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
@leihuagh
leihuagh / inputmask-forms.html
Last active October 4, 2019 15:57
inputmaskform
<!DOCTYPE html>
<html lang="en">
<head>
<base href="./../">
<title>CoreUI - Masked Input Forms</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
<!-- Icons-->
@leihuagh
leihuagh / shadows.scss
Created April 30, 2019 01:36 — forked from paulmelnikow/shadows.scss
Sass Mixin: Google Material Design Shadow
/**
* A mixin which helps you to add depth to elements according to the Google Material Design spec:
* http://www.google.com/design/spec/layout/layout-principles.html#layout-principles-dimensionality
*
* Please note that the values given in the specification cannot be used as is. To create the same visual experience
* the blur parameter has to be doubled.
*
* Adapted from a LESS version at https://medium.com/@Florian/freebie-google-material-design-shadow-helper-2a0501295a2d
*
* Original Author: Florian Kutschera (@gefangenimnetz), Conceptboard GmbH (@conceptboardapp)
const copyToClipboard = str => {
const el = document.createElement('textarea');
el.value = str;
document.body.appendChild(el);
el.select();
document.execCommand('copy');
document.body.removeChild(el);
};
@leihuagh
leihuagh / settings.py
Created January 2, 2019 00:18
django connect to postgresql
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': '<your database name>',
'USER': '<username>',
'PASSWORD': '<password>',
'HOST': 'localhost',
'PORT': '5433'
}
}
@leihuagh
leihuagh / settings.py
Created December 26, 2018 15:20
django local settings
try:
from .local_settings import *
except ImportError:
pass
@leihuagh
leihuagh / django connect to mysql
Created December 14, 2018 19:54
django connect to mysql
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': '<database name>',
'USER': '<username>',
'PASSWORD': '<password>',
'HOST': 'localhost',
'PORT': '3306',
'OPTIONS': {
'init_command': 'SET innodb_strict_mode=1',
@leihuagh
leihuagh / git branch overflow settings
Created December 14, 2018 17:40
git branch settings
git config --global pager.branch false