Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Hoa script, Check if script is being run by root
if [[ $EUID -ne 0 ]]; then
printf "This script must be run as root!\n"
exit 1
fi
DIVIDER="\n***************************************\n\n"
@hoahovan
hoahovan / # Sublime Emmet JSX Reactjs.md
Created July 15, 2017 16:07 — forked from max-mykhailenko/# Sublime Emmet JSX Reactjs.md
Sublime text 3. Enable Emmet in JSX files with Sublime React plugin

This is no longer needed as Emmet supports JSX - you just need to turn it all on. Did a quick tutorial: http://wesbos.com/emmet-react-jsx-sublime/

Thanks, @wesbos

Problem

  • Using emmet in jsx files
  • Emmet expands text when js autocomplete needed
@hoahovan
hoahovan / wordpress-firebase.php
Created November 22, 2016 03:37 — forked from derekconjar/wordpress-firebase.php
An example of using Firebase and WordPress together. The idea is to use WP's custom post types and metaboxes to make content management easy, and sync with Firebase so that your websites have access to a real-time JSON feed of your custom data.
<?php
/**
* All custom functions should be defined in this class
* and tied to WP hooks/filters w/in the constructor method
*/
class Custom_Functions {
// Custom metaboxes and fields configuration
@hoahovan
hoahovan / convDate2.php
Created October 5, 2016 02:19 — forked from dungphanxuan/convDate2.php
PHPで西暦⇔和暦変換
<?php
//write kazua
function convGtJDate($src) {
list($year, $month, $day) = explode('/', $src);
if (!@checkdate($month, $day, $year) || $year < 1869 || strlen($year) !== 4
|| strlen($month) !== 2 || strlen($day) !== 2) return false;
$date = str_replace('/', '', $src);
if ($date >= 19890108) {
$gengo = '平成';