Skip to content

Instantly share code, notes, and snippets.

Shu Miyao BeFiveINFO

Block or report user

Report or block BeFiveINFO

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
BeFiveINFO / components-Adsense.vue
Last active Jul 15, 2019
Adsense for Gridsome
View components-Adsense.vue
<ins class="adsbygoogle"
export default {
BeFiveINFO /
Created Jan 4, 2019
[Python3] Batch Download Files by URLs Listed in a Text File
#-*- coding:utf-8 -*-
import re
import requests
import os
# Function to parse url in a file one by one into a list
def loadTextFile(filePath):
lines = [line.rstrip('\n') for line in open(filePath)]
return lines
BeFiveINFO / list.js
Created Oct 25, 2018
[Node.JS] Open a JSON file and list each one of values of a key
View list.js
// require
var fs = require("fs");
var sourceData = fs.readFileSync("ttl.json","utf8");
sourceData = JSON.parse(sourceData);
for(const categoryName in sourceData){
BeFiveINFO /
Created Oct 12, 2018 — forked from joeshub/
Sync your Sublime Text 3 Settings using iCloud Drive on multiple Macs
# Notes
# Using iCloud Drive, you can sync your Sublime Text 3
# plugins and prefs so you can always have the same setup
# Prerequisites
# Make sure both machines have the latest version of OSX 10.10.x with
# Yosemite or higher and iCloud Drive turned on
BeFiveINFO / gist:258b62f4eadc0e9eee26ed77b881fdfb
Created Oct 3, 2018
Scrape page url and title of a tags by using jQuery
View gist:258b62f4eadc0e9eee26ed77b881fdfb
var a = jQuery(' .mega-sub-menu.row');
var aa = [];
var b = $(e).text();
var c = $(e).attr('href');
BeFiveINFO / gist:c27f64e92babcc46b5ba24d67abc7e48
Created Oct 2, 2018
[WordPress] Get all the page url in WP multisite
View gist:c27f64e92babcc46b5ba24d67abc7e48
// throw the following into functions.php of a theme etc.
$site_ids = array(1,2,3); // site ids
foreach($site_ids as $bid){
switch_to_blog( $bid );
$pages = get_pages(array('post_type' => 'page'));
$current_site_home = get_site_url().'/';
BeFiveINFO /
Created Feb 8, 2018
Bulk validate for Nu Html Checker
# Requirements:
# - Nu Html Checker Validation server, preferably the one running on your own.
# - curl
# Usage:
# bulk_validation -l http://validation.server.address urllist.txt resultsouput.json
# -l option is to specify a validation server http address.
# The urllist.txt has a list of url with one url each line.
View backend.min.js
function vc_toTitleCase(str) {
return str.replace(/\w\S*/g, function(txt) {
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase()
function vc_convert_column_size(width) {
var numbers = width ? width.split("/") : [1, 1],
range = _.range(1, 13),
num = !_.isUndefined(numbers[0]) && 0 <= _.indexOf(range, parseInt(numbers[0], 10)) && parseInt(numbers[0], 10),
View htaccess redirecting to other servre
# any external incoming request to images hosted are redirected to other server holding dummy of the original content
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?thememountain\.com/ [NC]
RewriteRule (.*)\.(jpe?g|gif|ogv|webm|bmp|png|mp4|svg|css)$$1.$2 [NC,R,L]
BeFiveINFO /
Created Mar 28, 2017
File list and template replacement example
sectionTemplate="$(cat ../section_template.php)"
while read line
array[ $i ]="$line"
(( i++ ))
done < <(ls)
You can’t perform that action at this time.