Skip to content

Instantly share code, notes, and snippets.

View rougeth's full-sized avatar

Marco Rougeth rougeth

View GitHub Profile
from functools import reduce
def center(words):
max_length = reduce(lambda a, b: a if a > len(b) else len(b), words, 0)
words = [word if len(word) == max_length else '{}{}'.format(' ' * ((max_length - len(word)) // 2), word) for word in words]
for word in words: print(word)
import {connect} from 'react-redux';
function connector(mapStateToProps, mapDispatchToProps, composes, component) {
const conn = connect(mapStateToProps, mapDispatchToProps);
return conn(composes.reduce((a, b) => b(a(component))));
}

Se inscreva para os tutoriais aqui!

:author: Mário Sérgio 📅 2016-9-21 22:00 :image: /images/hack.jpg :summary:

A seguir, estão todos os tutoriais com seus respectivos links para inscrição:

@rougeth
rougeth / talk_tmux.md
Created March 11, 2016 18:55
talk about tmux
  _____/\\\______________________________________________________
   __/\\\\\\\\\\\____/\\\\\__/\\\\\____/\\\____/\\\__/\\\____/\\\_
    _\////\\\////___/\\\///\\\\\///\\\_\/\\\___\/\\\_\///\\\/\\\/__
     ____\/\\\______\/\\\_\//\\\__\/\\\_\/\\\___\/\\\___\///\\\/____
      ____\/\\\_/\\__\/\\\__\/\\\__\/\\\_\/\\\___\/\\\____/\\\/\\\___
       ____\//\\\\\___\/\\\__\/\\\__\/\\\_\//\\\\\\\\\___/\\\/\///\\\_
        _____\/////____\///___\///___\///___\/////////___\///____\///__
@rougeth
rougeth / nginxproxy.md
Created March 1, 2016 20:13 — 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

function prompt_char {
if [ $UID -eq 0 ]; then echo "#"; else echo $; fi
}
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)"
PROMPT='${ret_status}%{$fg_bold[white]%}%n %{$fg_bold[grey]%}at %{$fg_bold[blue]%}%m %{$fg_bold[grey]%}in %{$fg[green]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}
$(prompt_char) '
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[grey]%}on %{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
{
// Sets the colors used within the text area
"color_scheme": "Packages/Dracula Color Scheme/Dracula.tmTheme",
// Note that the font_face and font_size are overriden in the platform
// specific settings file, for example, "Preferences (Linux).sublime-settings".
// Because of this, setting them here will have no effect: you must set them
// in your User File Preferences.
"font_face": "",
"font_size": 10,
@rougeth
rougeth / osx.md
Last active August 29, 2015 13:56

Copied and modified from Zeno Rocha's OS X Maverick setup guide


1. Run Software Update

Make sure everything is up to date.

Software Update

Editar
sudo gedit /usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules.cache
sudo gedit /usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/gtk.immodules
Adicionar :en na linha "cedilla"
sudo gedit /usr/share/X11/locale/en_US.UTF-8/Compose
substituir "ć" por "ç" e "Ć" por "Ç".
@rougeth
rougeth / ubuntu-post-install.sh
Last active May 30, 2021 17:24
A post-installation bash script for Ubuntu (13.10)
#!/bin/bash
#
# Ubuntu post-install script
#
# Author:
# Marco Rougeth <marco@rougeth.com>
#
# Description:
# A post-installation bash script for Ubuntu (13.10)
#