Skip to content

Instantly share code, notes, and snippets.

View roberto's full-sized avatar
🍊

Roberto Soares roberto

🍊
View GitHub Profile
@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:
@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.
@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.

@ohanhi
ohanhi / frp.md
Last active December 23, 2022 13:06
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

@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);
@vitorbritto
vitorbritto / add_apache_brew.md
Last active March 4, 2019 10:30
Install Apache with Homebrew

Install Apache with Homebrew

Installing Apache

# Start by stopping the built-in Apache, if it's running, and prevent it from starting on boot.
# This is one of very few times you'll need to use sudo:
sudo launchctl unload /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null

# We need to tap homebrew-dupes because "homebrew-apache/httpd22" relies on "homebrew-dupes/zlib"

and install Apache 2.2 with the event MPM, and we'll use Homebrew's OpenSSL library

@KidkArolis
KidkArolis / webpack.config.js
Last active October 16, 2023 04:00
Webpack for AMD projects
/**
* Example webpack.config.js for an AMD project (or AMD + CJS mixed project).
* This file should be at the root of your project.
*
* This can then be used in combination with Karma as well
* Just load this file and pass it to karma.webpack key
* (see https://github.com/webpack/karma-webpack#alternative-usage)
*
* This example is a bit extreme. Typically in webpack, you don't need much
* configuration if you have nicely behaving code and work with correctly
@brianloveswords
brianloveswords / git-obliterate
Last active January 24, 2024 12:28
git-obliterate: for removing sensitive files you may have committed from the entire history of the project.
#!/bin/bash
file=$1
test -z $file && echo "file required." 1>&2 && exit 1
git filter-branch -f --index-filter "git rm -r --cached $file --ignore-unmatch" --prune-empty --tag-name-filter cat -- --all
git ignore $file
git add .gitignore
git commit -m "Add $file to .gitignore"
@fsouza
fsouza / str.go
Last active December 20, 2015 10:31
package str
func Reverse(input string) string {
return ""
}
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 19, 2024 11:00
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: