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
// use as | |
// <EmbedWebView | |
// html = ".. html codes you get from Iframely .." | |
// /> | |
import React, { Component } from 'react'; | |
import { WebView, View } from 'react-native'; | |
// will receive height data from WebView | |
function parseMessage(data) { |
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
# Bypass oEmbed sandbox for store links, add UTM params into the summary card | |
add_filter( 'pre_oembed_result', 'add_utm_params_to_barstool_store', PHP_INT_MAX, 3 ); | |
function add_utm_params_to_barstool_store ( $result, $url, $args ) { | |
if ( strpos($url, 'https://store.barstoolsports.com') !== false && strpos($url, 'utm_') === false ) { | |
$api_key = trim( get_site_option( 'iframely_api_key' ) ); | |
$link = $url; | |
$link = add_query_arg( array( | |
'utm_source' => 'barstoolsports', |
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 t = window.twttr = window.twttr || {}; | |
t._e = t._e || []; | |
t.ready = function(f) { | |
t._e.push(f); | |
}; | |
twttr.ready(function (twttr) { | |
twttr.events.bind( | |
'loaded', | |
function (event) { |
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 AMP_COMPONENTS_ON_DEMAND = { | |
"apester-media": "v0/amp-apester-media-0.1.js", | |
"brightcove": "v0/amp-brightcove-0.1.js", | |
"dailymotion": "v0/amp-dailymotion-0.1.js", | |
"facebook-page": "v0/amp-facebook-page-0.1.js", | |
"facebook": "v0/amp-facebook-0.1.js", | |
"gfycat": "v0/amp-gfycat-0.1.js", | |
"gist": "v0/amp-gist-0.1.js", | |
"iframe": "v0/amp-iframe-0.1.js", |
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
{"rules":[{ | |
"class": "InteractiveRule", | |
"selector" : "figure.wp-block-embed", | |
"properties" : { | |
"interactive.iframe" : { | |
"type" : "children", | |
"selector" : "div.wp-block-embed__wrapper" | |
} | |
} | |
}] |
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 AMP_SCRIPTS = { | |
"apester-media": "https://cdn.ampproject.org/v0/amp-apester-media-0.1.js", | |
"iframely": "https://cdn.ampproject.org/v0/amp-iframely-0.1.js", | |
"iframe": "https://cdn.ampproject.org/v0/amp-iframe-0.1.js", | |
"youtube": "https://cdn.ampproject.org/v0/amp-youtube-1.0.js" | |
}; | |
function getScript(html) { | |
const m = html && html.match(/^<amp-([a-z\-]+)/); | |
if (m) { |
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 moment = require('moment'); | |
module.exports = function log() { | |
var args = Array.prototype.slice.apply(arguments); | |
args = args.filter(i => typeof i !== 'undefined' && i !== null); | |
args.splice(0, 0, "--", "[" + moment().utc().format("YY-MM-DD HH:mm:ss") + "]"); | |
console.log.apply(console, args); | |
}; |
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/env python3.7 | |
import iterm2 | |
# Each top level item is new tab. | |
# Each second level item is new split pane session inside the tab. | |
windowsConfig = [ | |
# Max 4 sessions in one tab. | |
['echo 41', 'echo 42', 'echo 43', 'echo 44'], | |
['echo 31', 'echo 32', 'echo 33'], |
OlderNewer