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 fuzzy_search($search, $text, $distance = 3){ | |
$needles = explode(' ', mb_strtolower($search, 'UTF-8')); | |
$tokens = explode(' ', mb_strtolower($text, 'UTF-8')); | |
$score = 0; | |
$levenshtein_utf8 = function ($s1, $s2) { | |
$map = []; |
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
/** | |
<style> | |
.var-test:before { | |
content: 'hello'; | |
} | |
</style> |
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
/** | |
asyncexec(function(times){ | |
for (var x=0, y;x<times;x++) { | |
y = x/2; | |
} | |
release(x); | |
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
/* | |
* LetterAvatar | |
* | |
* Create Letter avatar based on Initials - | |
* based on https://gist.github.com/leecrossley/6027780 | |
*/ | |
(function(w, d){ | |
function LetterAvatar (name, size) { |
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() { | |
var styles, style, rules, rule, error, | |
props = ['backgroundColor', 'color'], primaryColor = 'red', replaceColor: 'blue'; | |
document.body.style.visibility = 'hidden'; | |
try { | |
styles = document.styleSheets; |
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
/** | |
USAGE: | |
Just load the script in the page loaded by the iframe. | |
<script src="seamless-iframe.js"></script> | |
**/ |
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
// | |
// returns a list of all elements under the cursor | |
// | |
function elementsFromPoint(x,y) { | |
var elements = [], previousPointerEvents = [], current, i, d; | |
// get all elements via elementFromPoint, and remove them from hit-testing in order | |
while ((current = document.elementFromPoint(x,y)) && elements.indexOf(current)===-1 && current != null) { | |
// push the element and its current style |
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
/** | |
USAGE: | |
<script src="riot+compiler.min.js"></script> | |
<script src="riot.view.js"></script> | |
<script type="riot/tag" src="my-tag.tag"></script> | |
<div riot-view> |
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
/* | |
* copyright: https://github.com/atom/fuzzaldrin - https://github.com/atom/fuzzaldrin/blob/master/LICENSE.md | |
*/ | |
(function(global){ | |
var filter, scorer, FuzzySearch; | |
/* | |
Original ported from: |
NewerOlder