Skip to content

Instantly share code, notes, and snippets.

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

Minh Bằng minhbang

🏠
Working from home
View GitHub Profile
@minhbang
minhbang / wp-admin-modal-dialog.php
Created January 8, 2018 13:44 — forked from anttiviljami/wp-admin-modal-dialog.php
WordPress admin modal dialog example
<?php
// enqueue these scripts and styles before admin_head
wp_enqueue_script( 'jquery-ui-dialog' ); // jquery and jquery-ui should be dependencies, didn't check though...
wp_enqueue_style( 'wp-jquery-ui-dialog' );
?>
<!-- The modal / dialog box, hidden somewhere near the footer -->
<div id="my-dialog" class="hidden" style="max-width:800px">
<h3>Dialog content</h3>
<p>This is some terribly exciting content inside this dialog. Don't you agree?</p>
@minhbang
minhbang / fetch_gdrive_file.sh
Created January 6, 2018 01:38 — forked from ppetraki/fetch_gdrive_file.sh
allows you do non-interactively download large public files from gdrive
#!/bin/bash
SOURCE="$1"
if [ "${SOURCE}" == "" ]; then
echo "Must specify a source url"
exit 1
fi
DEST="$2"
if [ "${DEST}" == "" ]; then
@minhbang
minhbang / install-tmux.sh
Created January 1, 2018 09:06 — forked from pokev25/install-tmux.sh
Install tmux 2.3 on rhel/centos 6
# Install tmux on Centos release 6.5
# install deps
yum install gcc kernel-devel make ncurses-devel
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
curl -OL https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz
tar -xf libevent-2.0.22-stable.tar.gz
cd libevent-2.0.22-stable
./configure --prefix=/usr/local
@minhbang
minhbang / centos_python.sh
Last active January 1, 2018 07:59 — forked from selfboot/centos_python.sh
CentOS 6.8: Install Python 2.7.14, pip, virtualenv, and virtualenvwrapper on CentOS
#!/bin/bash
# According to:
# How To Set Up Python 2.7.6 and 3.3.3 on CentOS 6.4
# https://www.digitalocean.com/community/tutorials/how-to-set-up-python-2-7-6-and-3-3-3-on-centos-6-4
yum -y update
yum groupinstall -y 'development tools'
yum install -y zlib-dev openssl-devel sqlite-devel bzip2-devel
yum install xz-libs
wget http://www.python.org/ftp/python/2.7.14/Python-2.7.14.tar.xz

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

@minhbang
minhbang / install-elasticsearch-centos.sh
Created January 17, 2016 01:17 — forked from ondrej-kvasnovsky/install-elasticsearch-centos.sh
Commands for ElasticSearch installation on CentOS 6.4
# install missing libraries (if any)
cd ~
sudo yum update
yum install java-1.7.0-openjdk.x86_64
yum install unzip
yum install mc
yum install wget
yum install curl
# get and unpack elasticsearch zip file
@minhbang
minhbang / es.sh
Created January 17, 2016 01:17 — forked from rajraj/es.sh
Install ElasticSearch on CentOS 6
cd ~
sudo yum update
sudo yum install java-1.7.0-openjdk.i686 -y
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.9.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share

1. Download the phpseven branch of the imagick repository

git clone https://github.com/mkoppanen/imagick/tree/phpseven imagick

2. phpize for target PHP version

cd imagick && /path/to/php7/bin/phpize && ./configure && make && make install

3. Enable the extension for your PHP version

@minhbang
minhbang / libgs_install.sh
Created January 7, 2016 09:37 — forked from masbog/libgs_install.sh
Installing ghostscript 9 CentOS 6.5 with shared Library
curl -O http://downloads.ghostscript.com/public/ghostscript-9.14.tar.gz &&
tar -xzf ghostscript-9.14.tar.gz &&
cd ghostscript-9.14 &&
./configure &&
make install &&
make so &&
cp ghostscript-9.14/sobin/libgs.so.9.14 /usr/lib &&
ln -s /usr/lib/libgs.so.9.14 /usr/lib/libgs.so &&
mkdir -p /etc/ld.so.conf.d/ &&
echo "/usr/lib/libgs.so" > /etc/ld.so.conf.d/libgs.conf &&
@minhbang
minhbang / Bootstrap-3_Carousel-Collection
Created December 30, 2015 08:40 — forked from loschke/Bootstrap-3_Carousel-Collection
Bootstrap 3 - Carousel Collection Pack