This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const $Fs = require('fs'); | |
const { JSDOM } = require('jsdom'); // uninstall when done | |
const htmlText = ` | |
<div id="target"> | |
<p>test</p> | |
</div> | |
`; | |
const _htmlTextDom = new JSDOM(htmlText); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/node | |
'use strict'; | |
const $Fs = require('fs'); | |
const $Path = require('path'); | |
const $Glob = require('glob'); | |
const { JSDOM } = require('jsdom'); // uninstall when done | |
const $Beautify = require('js-beautify'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"disable-color-correct-rendering": true, | |
"disable-hardware-acceleration": true | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<ins class="adsbygoogle" | |
:data-ad-client="adClient" | |
:data-ad-slot="adSlot" | |
:data-ad-format="adFormat" | |
:style="adStyle"></ins> | |
</template> | |
<script> | |
export default { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python3 | |
#-*- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/node | |
// require | |
var fs = require("fs"); | |
var sourceData = fs.readFileSync("ttl.json","utf8"); | |
sourceData = JSON.parse(sourceData); | |
for(const categoryName in sourceData){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var a = jQuery('.main-menu-item.menu-item-even.menu-item-depth-0.contains-mega-sub-menu.menu-item.menu-item-type-post_type.menu-item-object-page.menu-item-has-children .mega-sub-menu.row a.menu-link'); | |
var aa = []; | |
a.each(function(i,e){ | |
var b = $(e).text(); | |
var c = $(e).attr('href'); | |
aa.push({title:b,url:c}); | |
}); | |
JSON.stringify(aa); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// 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().'/'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# 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. |
NewerOlder