This file contains hidden or 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
function intersection(a, b) { | |
var result = []; | |
for (var i = 0; i < a.length; i++) { | |
if (b.indexOf(a[i]) > -1) { | |
result.push(a[i]); | |
} | |
} | |
return result.sort(); |
This file contains hidden or 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
function intersection(a, b) { | |
var result = []; | |
for (var i = 0; i < a.length; i++) { | |
for (var j = 0; j < b.length; j++) { | |
if (a[i] === b[j]) { | |
result.push(a[i]); | |
break; | |
} | |
} |
This file contains hidden or 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
function intersection(a, b) { | |
return a.filter(value => b.indexOf(value) > -1).sort(); | |
} |
This file contains hidden or 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
# Enable GZIP | |
<ifmodule mod_deflate.c> | |
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript | |
</ifmodule> | |
# END GZIP | |
<IfModule mod_filter.c> | |
AddOutputFilterByType DEFLATE "application/atom+xml" \ | |
"application/javascript" \ | |
"application/json" \ |
This file contains hidden or 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
PREFIX=/opt/local | |
SRC=$PREFIX/src/phantomjs | |
DOWNLOAD_FILE=phantomjs-1.9.8-smartos-i386.tgz | |
DOWNLOAD_URL=https://us-east.manta.joyent.com/pkgsrc/public/packages/SmartOS/phantomjs/$DOWNLOAD_FILE | |
# Create directory where we are going to put phantomjs' source files | |
mkdir -p $SRC | |
# Go into dir, download and extract archive | |
cd $SRC | |
wget $DOWNLOAD_URL |
This file contains hidden or 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 path = require('path'); | |
// `npm install --save hoodie-plugins-api` in your plugin dir | |
var PluginAPI = require('hoodie-plugins-api').PluginAPI; | |
// | |
// Poor man's hoodie API. | |
// | |
function getHoodie(settings) { | |
var hoodieAdmin = { | |
user: process.env.HOODIE_ADMIN_USER, |
This file contains hidden or 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 psl = require('psl'); | |
var parsed = psl.parse('www.食狮.中国'); | |
console.log(parsed.tld); // '中国' | |
console.log(parsed.sld); // '食狮' | |
console.log(parsed.domain); // '食狮.中国' | |
console.log(parsed.subdomain); // 'www' | |
var parsed2 = psl.parse('shishi.中国'); |
This file contains hidden or 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 psl = require('psl'); | |
var parsed = psl.parse('a.b.ide.kyoto.jp'); | |
console.log(parsed.tld); // 'ide.kyoto.jp' | |
console.log(parsed.sld); // 'b' | |
console.log(parsed.domain); // 'b.ide.kyoto.jp' | |
console.log(parsed.subdomain); // 'a' | |
var parsed2 = psl.parse('www.sony.jp'); |
This file contains hidden or 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 psl = require('psl'); | |
var parsed = psl.parse('a.b.c.d.foo.uk.com'); | |
console.log(parsed.tld); // 'uk.com' | |
console.log(parsed.sld); // 'foo' | |
console.log(parsed.domain); // 'foo.uk.com' | |
console.log(parsed.subdomain); // 'a.b.c.d' |
This file contains hidden or 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
<html> | |
<head> | |
<title>Test</title> | |
<script type="text/javascript"> | |
'use strict'; | |
(function () { | |
console.log('Got here.'); | |
}()); | |
</script> |