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
// abs.js | |
const FILES = require('fs'); | |
module.exports = { | |
absorb: (htmlPath) => { | |
let html = FILES.readFileSync(htmlPath, 'utf8'); | |
html = html.replace(/(<absorb\s(.+)\/>)/g, function(absorbElement) { | |
let filePath = '', fileType = '', jsMod = ''; | |
if (absorbElement.indexOf('css=') >= 0) { |
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
writeln("setting up server...") | |
server := HttpServer clone do( | |
setPort(8090) | |
renderResponse := method(request, response, | |
list("path", "uri", "body") foreach(k, | |
v := request perform(k) | |
response body appendSeq(k .. ": " .. v .. "<br>") | |
) |
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 ajax = require('utils/ajax'); | |
const Promise = require('Promise'); | |
/* | |
* The queue itself... | |
* | |
* @param {String} retryConut The number of times that it should retry a request | |
* before it gives up and rejects it. | |
* | |
* @return {object} |
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 saveQueue = [ | |
slide, | |
slide1, | |
slide2, | |
slide | |
]; | |
const attemptedSlides = {}; | |
const running = 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
getComputedBG = function (elem) { | |
var rtn = window.getComputedStyle(elem)['background-color'], | |
element = elem, | |
isTransparent = function (color) { | |
return color === 'rgba(0, 0, 0, 0)' || color === 'transparent' | |
}; | |
while (element !== null && isClear(rtn)) { | |
element = element.parentElement; | |
rtn = window.getComputedStyle(element)['background-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
var createSummary = function(str){ | |
var str = str | |
//tag replacement stuff | |
, tagRegex = /<[^>]*>?/g | |
, markerRegexGlobal = /~/g | |
, markerRegex = /~/ | |
, marker = '~' | |
//other vars that we will need | |
, refString = str.replace(tagRegex, marker) //replace out tags | |
, i = 0 |
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
javascript:!function(){var a=document.createElement("script"),b=function(){var a=$("p"),b=0,c="",d="";for(b=0;b<a.length;b++)c=$(a[b]).text(),d=c.slice(0,45)+"*"+c.slice(45,70)+"*"+c.slice(70),$(a[b]).text(d)};a.src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js",document.getElementsByTagName("head")[0].appendChild(a),setTimeout(b,500)}(); |
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
t = ['john']; | |
c = ['daniel','joe']; | |
t.push(c); | |
c.push(t); | |
c; |
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 http = require('http'); | |
var server = http.createServer(function (req, res) { | |
console.log(req.url); | |
if (req.url !== '/api/presence' && req.url !== '/api/heartbeat') { | |
res.statusCode = 500; | |
res.end('error'); | |
} else { | |
res.end('works'); | |
} |
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
#!/bin/sh | |
rm -rf node_modules/ | |
npm install |