Skip to content

Instantly share code, notes, and snippets.

View fpontef's full-sized avatar
👋
Working from home

Fernando Ponte Filho fpontef

👋
Working from home
  • Brazil - Fortaleza, CE
View GitHub Profile
@fpontef
fpontef / tmux.md
Created May 28, 2016 03:21 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@fpontef
fpontef / nginxproxy.md
Created June 30, 2016 14:54 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@fpontef
fpontef / request.js
Created September 16, 2016 20:33 — forked from anonymous/request.js
const stringfy = (value) => JSON.stringify([value]);
const stringfyAndTransformToObject = (value) => ({ object: stringfy(value) })
const makeRequest = () => {
const context = arguments[0] || this;
const post = (url, data, options) => context.$http(url, stringfyAndTransformToObject(data), options);
return { post };
};
const install = (VueInstance) => {
@fpontef
fpontef / arch-on-mb.md
Created September 25, 2016 15:33
Installing Arch on a MacBook
<template>
<root-header></root-header>
<!-- BEGIN CONTAINER -->
<div class="page-container">
<root-sidebar></root-sidebar>
<!-- BEGIN CONTENT -->
<div class="page-content-wrapper">
<!-- BEGIN CONTENT BODY -->
<slot></slot>
<!-- END CONTENT BODY -->
@fpontef
fpontef / gist:778ca0d850d368c7330b9c2990485abc
Created October 14, 2016 20:53 — forked from chad3814/gist:2924672
deleting array items in javascript with forEach() and splice()
// This is from my comment here: http://wolfram.kriesing.de/blog/index.php/2008/javascript-remove-element-from-array/comment-page-2#comment-466561
/*
* How to delete items from an Array in JavaScript, an exhaustive guide
*/
// DON'T use the delete operator, it leaves a hole in the array:
var arr = [4, 5, 6];
delete arr[1]; // arr now: [4, undefined, 6]
@fpontef
fpontef / exercicio_wall.py
Created April 5, 2017 01:58
Python testador de primos...
# Primo:
# Exceto 2, não pode ser par.
# Deve ser divisivel somente por 1 e por ele mesmo.
# Não pode ter outro divisor.
def ehPrimo(n):
divisivel = 0
x = 2
while x <= n:
#print("Dividindo", n, "por", x)
if (n % x == 0):
@fpontef
fpontef / index.jsx
Created October 9, 2017 21:22 — forked from jbinto/index.jsx
Egghead tutorial - Getting Started with Redux - JSBin implementation
/* global ReactRedux, Redux, ReactDOM */
// "Getting Started with Redux" (by Dan Abramov)
// https://egghead.io/series/getting-started-with-redux
// This file on JSBin (by Jesse Buchanan):
// http://jsbin.com/wuwezo/74/edit?js,console,output
////////////////////////////////////////////////
//