Skip to content

Instantly share code, notes, and snippets.

View o0101's full-sized avatar
🏖️
Netscaping

Cris o0101

🏖️
Netscaping
View GitHub Profile
@rxaviers
rxaviers / gist:7360908
Last active May 25, 2024 09:18
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
import React from 'react';
import BuildingList from './BuildingList';
class Brutal extends React.Component {
render() {
return(
<div>
<nav>
@sagivo
sagivo / gist:3a4b2f2c7ac6e1b5267c2f1f59ac6c6b
Last active May 20, 2024 15:38
webRTC stun / turn server list
to check if the server works - https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice
stun:
stun.l.google.com:19302,
stun1.l.google.com:19302,
stun2.l.google.com:19302,
stun3.l.google.com:19302,
stun4.l.google.com:19302,
stun.ekiga.net,
stun.ideasip.com,
@sj26
sj26 / LICENSE.md
Last active March 8, 2024 18:31
Bash retry function

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit

@o0101
o0101 / render.js
Created May 23, 2017 06:27
Easiest way to create HTML document fragments from text
"use strict";
{
function df( t ) {
return (new DOMParser).parseFromString(`<template>${t}</template>`,"text/html").head.firstChild.content;
}
function fc( t ) {
const article = document.createElement('article');
article.innerHTML = t;
return article.firstChild;
@o0101
o0101 / tifumini.js
Last active June 17, 2017 18:20
tifuhash 32 bit in a mini package
// tifuhash 32-bit (c) dosyago & k stringfellow 2017 MIT LICENSE https://www.npmjs.com/package/tifuhash
let f = ( s = 0, m = '', ...n ) => {
s = parseFloat(s); m = Array.from(m).concat(n).map(x => isNaN(parseFloat(x)) ? x.charCodeAt(0) : parseFloat(x));
let a=new Float64Array(4);
a[0] = 1;
a[2] = s ? Math.pow(s+1/s, 1/2) : 3;
a[3] = s ? Math.pow(s+1/s, 1/5) : 7;
m.forEach((x,i) => {
a[1] = (x+i+1)/a[3];
@o0101
o0101 / one.js
Last active September 15, 2017 19:21
5lines - useful utils in 5 lines or less
/* 5lines - function body must be not more than 5 SLOC */
// encrypt a string, also decrypt a string
function encrypt(key, str, s = 1) {
// clean
s = Number.isNaN(parseInt(s)) ? 1 : parseInt(s);
// turn key into numbers
key = new Uint16Array([...key].map( k => k.codePointAt(0) ));
// write generator to produce RNG
const rng = (function*(){while(true){yield(key.reduce((K,k,i)=>(key[(i+s)%key.length]+=k, k=(k<<1||k>>15),K+k),s),key[0])}}());
@o0101
o0101 / index.html
Created September 23, 2017 18:15 — forked from anonymous/index.html
Bookmarklet // source https://jsbin.com/nosefuduju
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Bookmarklet</title>
</head>
<body style="max-width:700px; margin:0 auto;">
<p>Here is the bookmarklet:
<a href="javascript:(function()%7B(function()%20%7Bconst%20req%20%3D%20new%20XMLHttpRequest()%3Bconst%20key%20%3D%20'AIzaSyAUYMRSUW3BAZLhSTbB1poQuQ4xaqt2C4c'%3Breq.open('POST'%2C%20'https%3A%2F%2Fwww.googleapis.com%2Furlshortener%2Fv1%2Furl%3Fkey%3D'%2Bkey)%3Breq.setRequestHeader(%22Content-Type%22%2C%20%22application%2Fjson%22)%3Breq.responseType%3D%22json%22%3Breq.send(JSON.stringify(%7BlongUrl%3Alocation.href%7D))%3Bconst%20text%20%3D%20document.createElement('textarea')%3Blet%20result%3BsetTimeout(%20()%20%3D%3E%20(document.execCommand('copy')%2Ctext.remove())%2C%20700%20)%3Breq.onreadystatechange%20%3D%20()%20%3D%3E%20%7Bif%20(%20req.status%20%3D%3D%20200%20%26%26%20req.readyState%20%3D%3D%204%20)%20%7Bdocument.body.appendChild(text)%3Btext.value%20%3D%20req.response.id%3Btext.se
@o0101
o0101 / neucomponents.js
Last active September 24, 2017 04:25
It all sucks. Time to make it better.
/**
So dosyhil gives good components on the server.
What about the client?
**/
// example
const components = {};
Object.assign( self, { components } );
def`
@o0101
o0101 / wow.js
Created September 28, 2017 09:45
Micro Spread Sheet
// check this: http://jsfiddle.net/ondras/hYfN3/