Skip to content

Instantly share code, notes, and snippets.

(function (){
"use strict";
window.sel=window.sel||{};
/* Start Ajax */
function get(url) { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { return this.responseText; } };xhttp.open("GET", url, true);xhttp.send();}function post(url, params) { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { return this.responseText; } };xhttp.open("POST", url, true);xhttp.send(params);} window.sel.ajax = {get:get,post:post};
/* End Ajax */
/* Start HTML */
function query(q){return document.querySelector(q);} window.sel.html = {query:query}; window.sel.q = query;
})();
@easrng
easrng / index.html
Created January 11, 2019 22:06
maQdRo
<div class=" navbar-fixed">
<nav>
<div class="orange nav-wrapper">
<span class="brand-logo">InfiniteBoard</span>
</div>
</nav>
</div>
<main class="m5">
</main>
/*
elizabot.js v.1.1 - ELIZA JS library (N.Landsteiner 2005)
Eliza is a mock Rogerian psychotherapist.
Original program by Joseph Weizenbaum in MAD-SLIP for "Project MAC" at MIT.
cf: Weizenbaum, Joseph "ELIZA - A Computer Program For the Study of Natural Language
Communication Between Man and Machine"
in: Communications of the ACM; Volume 9 , Issue 1 (January 1966): p 36-45.
JavaScript implementation by Norbert Landsteiner 2005; <http://www.masserk.at>
synopsis:
.header-bar, .info{
display:none;
}
@easrng
easrng / customstorage.js
Last active April 2, 2020 21:24
A way to implement custom localStorage alternatives.
function customStorage(backing){
var has = Object.prototype.hasOwnProperty
, storage = {};
/**
* Refresh the storage as other users might also be writing against it.
*
* @api private
*/
[16:15:06 WARN] [io.netty.channel.AbstractChannel]: Force-closing a channel whose registration task was not accepted by an event loop: [id: 0x444ab536]
java.util.concurrent.RejectedExecutionException: event executor terminated
at io.netty.util.concurrent.SingleThreadEventExecutor.reject(SingleThreadEventExecutor.java:846) ~[DragonProxy.jar:0.0.2-SNAPSHOT]
at io.netty.util.concurrent.SingleThreadEventExecutor.offerTask(SingleThreadEventExecutor.java:329) ~[DragonProxy.jar:0.0.2-SNAPSHOT]
at io.netty.util.concurrent.SingleThreadEventExecutor.addTask(SingleThreadEventExecutor.java:322) ~[DragonProxy.jar:0.0.2-SNAPSHOT]
at io.netty.util.concurrent.SingleThreadEventExecutor.execute(SingleThreadEventExecutor.java:757) ~[DragonProxy.jar:0.0.2-SNAPSHOT]
at io.netty.channel.AbstractChannel$AbstractUnsafe.register(AbstractChannel.java:484) ~[DragonProxy.jar:0.0.2-SNAPSHOT]
at io.netty.channel.SingleThreadEventLoop.register(SingleThreadEventLoop.java:80) ~[DragonProxy.jar:
@easrng
easrng / wemoji.js
Last active December 12, 2019 22:31
Wemoji
(function(){
var style="apple";
function parse(eles){
eles.forEach(function(ele){
if(ele.textContent.match(/\:[a-zA-Z0-9._\-,]+\:/)){
var rw=emojify(ele.textContent);
ele.replaceWith(rw[0])
ele=rw[0]
if(rw.length>1){
@easrng
easrng / santa.py
Last active December 18, 2019 01:08
import urllib.request
class Santa:
def draw(self):
currentscreen[self.pos.y][self.pos.x]
santa=Santa()
WIDTH = 68
HEIGHT = 21
if (!window.OffscreenCanvas) {
window.OffscreenCanvas = class OffscreenCanvas {
constructor(width, height) {
this.canvas = document.createElement("canvas");
this.canvas.width = width;
this.canvas.height = height;
this.canvas.convertToBlob = () => {
return new Promise(resolve => {
this.canvas.toBlob(resolve);