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 fd = require('fast-diff'); | |
const getFontRanges = (node) => { | |
let fonts = []; | |
function searchCharacters(string, index) { | |
let font = node.getRangeFontName(index, index + string.length); | |
if (typeof font === 'object') { | |
let found = fonts.find(range => JSON.stringify(range.font) === JSON.stringify(font)); |
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
/* | |
1. Change the addEventListener calls so that the events occur in the following order. | |
the_div! the_item! the_list! | |
*/ | |
document.getElementById('the_div').addEventListener( | |
'click', function(){ log('the_div!') }, true); | |
document.getElementById('the_list').addEventListener( | |
'click', function(){ log('the_list!') }, false); | |
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 logCar = function(o) { | |
return console.log('I\'m a '+o.color+' '+o.make); | |
} | |
// logCar({ color: 'blue', make: 'BMW' }); | |
var Car = function(make, color) { | |
this.make = make; | |
this.color = color; |
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
(function(container){ | |
var index; | |
function log(){ | |
console.log(index); | |
} | |
function iterate(){ | |
log(); |
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 ua = navigator.userAgent; | |
var m = RegExp(/OS\s([\d+_?]*)\slike/i).exec(ua); | |
var version = m != null ? m[1].replace(/_/g, '.') : 4; | |
if (!(ua.match(RegExp('/ip(hone|ad|od)/i'))) || (ua.match(RegExp('/ip(hone|ad|od)/i')) && version >= 4)) { | |
try{Typekit.load();}catch(e){} | |
} |
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 | |
... | |
function textpattern() | |
{ | |
... | |
$html = @file_get_contents(txpath.'/../templates/pages/'.doSlash($pretext['page']).'.php'); | |
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 | |
... | |
function fetch_form($name) | |
{ | |
static $forms = array(); | |
if (isset($forms[$name])) | |
$f = $forms[$name]; |
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 | |
... | |
function txp_die($msg, $status='503') | |
{ | |
... | |
if (@$GLOBALS['connected']) { |