Skip to content

Instantly share code, notes, and snippets.

View roberto's full-sized avatar
🍊

Roberto Soares roberto

🍊
View GitHub Profile
@rogeriochaves
rogeriochaves / gist:ad633f47dab497a84ad0
Created May 8, 2015 17:08
Make ajax request fail
(function (originalOpen) {
XMLHttpRequest.prototype.open = function (method, url, async, user, password) {
if (url.match(/limits/)) url = "REJECTED";
originalOpen.call(this, method, url, async, user, password);
};
})(XMLHttpRequest.prototype.open);
@ohanhi
ohanhi / frp.md
Last active May 6, 2024 05:17
Learning FP the hard way: Experiences on the Elm language

Learning FP the hard way: Experiences on the Elm language

by Ossi Hanhinen, @ohanhi

with the support of Futurice 💚.

Licensed under CC BY 4.0.

Editorial note

@bltavares
bltavares / README.org
Last active September 5, 2016 17:22
How to remote pair over SSH

How to remote pair, over SSH?

If you are capable of direct access

Just connect; Done;

But… I’m behind NAT, and Firewalls and everything!

I thought so… The internet is not that easy of a place huh?! They told everybody would be connected, and promised again with IPv6, but I’m disgressing.

@trungdq88
trungdq88 / Handling Page Transitions on Single Page Web Apps.md
Last active July 18, 2018 08:57
Handling Page Transitions on Single Page Web Apps

Handling Page Transitions on Single Page Web Apps

zoom

Real world application with a lot of pages (or "screens") have to deal with problem managing the pages' DOM and memory efficiently and at the same provide a nice smooth transition effect between pages. This is not a real problem when you do it in native apps since Android or iOS already handle the hard work for you, but when come to JavaScript, HTML, and CSS, running on mobile browsers, this is the real challenge.

There are 2 common approaches to solve this problem:

  • Approach 1: Keep all the pages in the DOM tree, use CSS (for example display) to transit between pages.
@rogeriochaves
rogeriochaves / index.js
Created June 16, 2017 21:51
Redux implementation, basically
const React = require("react");
const ReactDOM = require("react-dom");
const reducer = (state, action) => {
switch (action) {
case "INCREMENT":
return state + 1;
case "DECREMENT":
return state - 1;
default: