Instantly share code, notes, and snippets.

# loopinglooping84

• Sort options
Created Jan 14, 2014 — forked from paulirish/rAF.js
View rAF.js
 // http://paulirish.com/2011/requestanimationframe-for-smart-animating/ // http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating // requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel // MIT license (function() { var lastTime = 0; var vendors = ['ms', 'moz', 'webkit', 'o'];
Created Feb 24, 2017 — forked from bradoyler/24.md
The 24 game in javascript
View 24.md

### The 24 Game

• tests one's mental arithmetic.

#### How it works:

• You are randomly given four digits, each from one to nine, with repetitions allowed.
• The goal is to enter an expression that evaluates to 24
##### Tips:
• Only multiplication, division, addition, and subtraction operators/functions are allowed.
• Division should use floating point or rational arithmetic, etc, to preserve remainders.
Created Jun 29, 2017 — forked from mrunderhill89/BehaviorTree.lua
Behavior Tree implementation in Lua.
View BehaviorTree.lua
 --[[ This behavior tree code was taken from our Zelda AI project for CMPS 148 at UCSC. It is for the most part unmodified, and comments are available for each function. Author: Kevin Cameron (mrunderhill89) ]]-- BT = {} BT.__index = BT BT.results = {success = "success" ,fail = "fail"
Created Jul 3, 2017 — forked from mebens/example.lua
View example.lua
 require("list") local a = { 3 } local b = { 4 } local l = list({ 2 }, a, b, { 5 }) l:pop() l:shift() l:push({ 6 }) l:unshift({ 7 })
Created Dec 7, 2018 — forked from liudongmiao/highlight.js
highlight word
View highlight.js
 function highlightWord(root, word, className) { // base on https://stackoverflow.com/a/10730063 // word is lower-case var walker, textNodes = []; walker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT, { acceptNode: function (node) { if (node.nodeType === Node.TEXT_NODE && node.textContent.toLowerCase().indexOf(word) >= 0) { return NodeFilter.FILTER_ACCEPT; } else {
You can’t perform that action at this time.