Skip to content

Instantly share code, notes, and snippets.

View RafaelC457ro's full-sized avatar

Rafael Castro RafaelC457ro

  • Brazil
View GitHub Profile
@RafaelC457ro
RafaelC457ro / pseudo_code_url_shortener.txt
Created July 3, 2018 17:32
pseudo code url shortener
while not quit do
read user input into string
parse string to struct using lexer()
if struct is type of SET do
generate key using base62 using struct data
insert key data into map
@RafaelC457ro
RafaelC457ro / event-loop.md
Created March 25, 2018 17:12 — forked from jesstelford/event-loop.md
What is the JS Event Loop and Call Stack?

Regular Event Loop

This shows the execution order given JavaScript's Call Stack, Event Loop, and any asynchronous APIs provided in the JS execution environment (in this example; Web APIs in a Browser environment)


Given the code

@RafaelC457ro
RafaelC457ro / user.js
Last active July 21, 2020 15:30 — forked from EtienneR/user.js
XMLHttpRequest RESTful (GET, POST, PUT, DELETE)
// Get all users
var url = 'https://reqres.in/api/users';
var xhr = new XMLHttpRequest()
xhr.open('GET', url, true)
xhr.onload = function () {
var users = JSON.parse(xhr.responseText);
if (xhr.readyState == 4 && xhr.status == '200') {
console.table(users);
} else {
console.error(users);
@RafaelC457ro
RafaelC457ro / index.html
Created October 26, 2017 19:28
Rxjs input file image compressed to base64 // source http://jsbin.com/tewiral
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Rxjs input file image compressed to base64</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/4.0.6/rx.all.js"></script>
<script src="https://unpkg.com/rx-dom@7.0.3/dist/rx.dom.js"></script>
<script src="https://cdn.rawgit.com/xkeshi/image-compressor/master/dist/image-compressor.js"></script>
  • Proxy windows para composer
SET HTTP_PROXY=http://111.111.1.1:8080
  • Proxy git
git config --global http.proxy http://111.111.1.1:8080
git config --global --unset http.proxy
  • NPM Proxy
http://hackingoff.com/compilers/regular-expression-to-nfa-dfa
http://stackoverflow.com/questions/1084069/building-a-regex-engine-online-resources
https://swtch.com/~rsc/regexp/
http://www.regular-expressions.info/engine.html
Resource for cors
http://www.html5rocks.com/en/tutorials/cors/?redirect_from_locale=pt
http://techblog.constantcontact.com/software-development/using-cors-for-cross-domain-ajax-requests/
https://www.soasta.com/blog/options-web-performance-with-single-page-applications/
https://remysharp.com/2011/04/21/getting-cors-working
Jquery not use cross-domain requests with custom headers -> https://github.com/jquery/jquery/blob/a117dd05f638a078c21dc57f19966f4ae81f98f0/src/ajax/xhr.js#L55