Skip to content

Instantly share code, notes, and snippets.

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

Quyen Nguyen decodedmrq

🏠
Working from home
View GitHub Profile
** Apache
- Edit public/.htaccess of laravel application with wordpress in subfolder
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
@decodedmrq
decodedmrq / three.doc.js
Created January 16, 2022 17:10 — forked from kopiro/three.doc.js
ThreeJS DeviceOrientationControls
/**
* @author richt / http://richt.me
* @author WestLangley / http://github.com/WestLangley
*
* W3C Device Orientation control (http://w3c.github.io/deviceorientation/spec-source-orientation.html)
*/
THREE.DeviceOrientationControls = function( object ) {
var scope = this;
"encodingJob": {
"M": {
"Role": {
"S": "arn:aws:iam::test:role/vod-test-MediaConvertRole-5I6IRWVD5W20"
},
"UserMetadata": {
"M": {
"workflow": {
"S": "vod-test"
},
@decodedmrq
decodedmrq / laravel-quickstart-project-docker.md
Created August 10, 2021 17:04 — forked from wataridori/laravel-quickstart-project-docker.md
Running Laravel Quick Start Project easily using Docker
  • Install Docker
    • Docker for Ubuntu: https://docs.docker.com/engine/installation/linux/ubuntulinux/
      sudo apt-get update && apt-get install -y apt-transport-https ca-certificates
      sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
      
      // Open the /etc/apt/sources.list.d/docker.list and add the following line then save it
      // Ubuntu 14.04
      deb https://apt.dockerproject.org/repo ubuntu-trusty main
      

// Ubuntu 16.04

@decodedmrq
decodedmrq / RegisterRequest.php
Created August 10, 2021 17:01 — forked from tuanpht/RegisterRequest.php
Laravel Form Request Testing
<?php
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rules\Unique;
class RegisterRequest extends FormRequest
{
const NAME_MAX_LENGTH = 255;
const EMAIL_MAX_LENGTH = 255;
const PASSWORD_MIN_LENGTH = 8;
@decodedmrq
decodedmrq / vhosts.conf
Created November 1, 2017 18:11
Laravel Virtual Host for Apache Example
<VirtualHost *:80>
DocumentRoot "/Users/myName/Projects/laravel/public"
ServerName myLaravel.dev
<Directory "/Users/myName/Projects/laravel/public">
AllowOverride All
Options FollowSymLinks +Indexes
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
@decodedmrq
decodedmrq / xmlrpc.php
Created July 7, 2021 18:19 — forked from hofmeister/xmlrpc.php
PHP simple XML-RPC Client
<?php
/**
* @author Henrik Hofmeister
* @license MIT
* @version 1.0
*
* XmlRPC using SimpleXML and CURL
*
* Usage:
*
@decodedmrq
decodedmrq / curl.md
Created July 6, 2021 17:27 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@decodedmrq
decodedmrq / Git-Pre-commit-setup.md
Created June 30, 2021 17:26 — forked from sdavara/Git-Pre-commit-setup.md
Git-pre-commit-hooks for PHP/Laravel Project

Pre Commit Setup

Setup pre-commit hook in php projects for lint, code standard, test cases etc.

Prerequisites

  • php >= 5.6
  • composer
  • git

Installation

@decodedmrq
decodedmrq / gist:3080091ea2b714e88e80c1343338f725
Created June 28, 2021 03:06
Get all Css Rules apply element (include media queries)
// polyfill window.getMatchedCSSRules() in FireFox 6+
if (typeof window.getMatchedCSSRules !== 'function') {
var ELEMENT_RE = /[\w-]+/g,
ID_RE = /#[\w-]+/g,
CLASS_RE = /\.[\w-]+/g,
ATTR_RE = /\[[^\]]+\]/g,
// :not() pseudo-class does not add to specificity, but its content does as if it was outside it
PSEUDO_CLASSES_RE = /\:(?!not)[\w-]+(\(.*\))?/g,
PSEUDO_ELEMENTS_RE = /\:\:?(after|before|first-letter|first-line|selection)/g;
// convert an array-like object to array