Skip to content

Instantly share code, notes, and snippets.

@nhuhoai
nhuhoai / bootstrap-bs-example.css
Last active June 21, 2017 09:30 — forked from Mithrandir0x/gist:3619682
"Example" style used in Bootstrap documentation.
.bs-example {
position: relative;
margin: 15px 0;
padding: 39px 19px 14px;
background-color: white;
border: 1px solid #DDD;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
@nhuhoai
nhuhoai / bootstrap-callout.css
Created June 22, 2017 12:23
Bootstrap Callout CSS Styles
/**
* Source: https://cpratt.co/twitter-bootstrap-callout-css-styles/
*/
.bs-callout {
padding: 20px;
margin: 20px 0;
border: 1px solid #eee;
border-left-width: 5px;
border-radius: 3px;
@nhuhoai
nhuhoai / install_php.sh
Last active January 21, 2018 11:49
Install PHP5.6, PHP7.0 & PHP7.1 for Debian
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root, use sudo "$0" instead" 1>&2
exit 1
fi
echo 'Add ondrej repository for PHP'
add-apt-repository ppa:ondrej/php -y > /dev/null
@nhuhoai
nhuhoai / wpa_supplicant.conf
Created December 15, 2020 16:52
WPA Supplicant config file (useful for headless Raspberry Pi)
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=«your_ISO-3166-1_two-letter_country_code»
network={
ssid="«your_SSID»"
psk="«your_PSK»"
key_mgmt=WPA-PSK
}
@nhuhoai
nhuhoai / print2.php
Last active January 18, 2021 10:23
Show contents while PHP script is running
<?php
/**
* Show contents while PHP script is running
* I found someday this script with MIT license but I lost the reference.
* It's mean I am not the author of this script, I just adapted for my own usage.
*
* PHP Version 7.4
*
* @category Function
@nhuhoai
nhuhoai / multicurl.php
Created January 18, 2021 10:58
Multi curl example
<?php
/**
* Multi curl example
*
* PHP Version 7.4
*
* @category Example
* @package MultiCurl
* @author Nhu-Hoai Robert Vo <[email protected]>
@nhuhoai
nhuhoai / curl_errno_list.php
Created April 1, 2021 08:33
cURL error number list
<?php
/**
* CURL error number list
*
* Sources:
* - https://www.php.net/manual/fr/function.curl-errno.php
* - https://curl.se/libcurl/c/libcurl-errors.html
* - https://timi.eu/docs/anatella/5_1_8_1_list-of-curl-error-co.html
*