Skip to content

Instantly share code, notes, and snippets.

View tranquangchau's full-sized avatar

Trần Quang Châu tranquangchau

View GitHub Profile
@tranquangchau
tranquangchau / symfony5-create-bundle.sh
Created February 14, 2020 04:05 — forked from sourcerebels/symfony2-create-bundle.sh
PHP > Symfony5 > Clear routes and twig templates cache
# Execute this from your Symfony2 path
php bin/console cache:clear --env=prod --no-debug
@tranquangchau
tranquangchau / read_csv.php
Created January 17, 2020 06:53 — forked from selwynpolit/read_csv.php
Php code to read a csv file of any size without exhausting memory and let you process it in chunks
/*
Reads a CSV file in chunks of 10 lines at a time
and returns them in an array of objects for processing.
Assumes the first line of the CSV file has headings
that will be used as the object name for the item you are
processing. i.e. the heading is CurrentURL then refer to
$item->CurrentURL
<div class="drop">
<div>
<img src="https://marketplace.canva.com/MAB0hy3YH9s/1/thumbnail/canva-arrow-MAB0hy3YH9s.png"/>
</div>
</div>
@tranquangchau
tranquangchau / gist:be42691ed017bf23a5781c4d4b424679
Created March 9, 2018 00:55 — forked from timonweb/gist:3165322
Code to catch all PHP errors which result in 500 Error Code. Include this snippet at the beginning of index.php file
<?php
define('E_FATAL', E_ERROR | E_USER_ERROR | E_PARSE | E_CORE_ERROR |
E_COMPILE_ERROR | E_RECOVERABLE_ERROR);
define('ENV', 'dev');
//Custom error handling vars
define('DISPLAY_ERRORS', TRUE);
define('ERROR_REPORTING', E_ALL | E_STRICT);
@tranquangchau
tranquangchau / README.md
Created January 7, 2017 19:25 — forked from nicerobot/README.md
Create Google Drive webViewLink folders via JavaScript.

Create Google Drive webViewLink folders via JavaScript (You must change CLIENT_ID before this will work.)

These folders are suitable for publishing websites. Once the folder is created, simply upload index.html and other resources to the folder.

@tranquangchau
tranquangchau / MainActivity.java
Created May 9, 2016 15:01 — forked from anonymous/MainActivity.java
android play mp3, mp4
package com.example.administrator.myapplication;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.media.session.MediaController;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
@tranquangchau
tranquangchau / bootstrap-scrollspy-horizontal.js
Last active August 28, 2015 09:26 — forked from joshuapekera/bootstrap-scrollspy-horizontal.js
Modified bootstrap-scrollspy.js to support horizontal scroll.
/* =============================================================
* bootstrap-scrollspy.js v2.0.1
* http://twitter.github.com/bootstrap/javascript.html#scrollspy
* =============================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
@tranquangchau
tranquangchau / bootstrap_3_full_class_list
Last active August 28, 2015 05:18 — forked from cosmicscr/bootstrap_3_full_class_list
bootstrap 3 full class list
Here are all the classes from Bootstrap 3 (version 3.1.1).
Method of extraction:
1. Download Bootstrap 3 and rename bootstrap.css as "bootstrap.html"
2. Add the following 24 lines of code to the very bottom of the bootstrap.html file:
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js"></script>
<script>