Skip to content

Instantly share code, notes, and snippets.

@lucasnogueira
lucasnogueira / Post-RubyRails.md
Created September 29, 2012 17:52
Para aprender Ruby e Rails

É difícil falar de Ruby sem mencionar seu framework web mais famoso, Ruby on Rails. Mas não adianta muito encarar o framework sem um prévio estudo da linguagem (o que de fato já observei acontecer inúmeras vezes). Esse post tem como intuito auxiliar na aprendizagem tanto da linguagem como do framework, para evitar que erros comuns como esse tornem a utilização de ambos um desastre.

Ruby

Ruby é uma linguagem de programação que apareceu para o mundo em 1995, criada por Yukihiro "Matz" Matsumoto. Tem como características o fato de ser uma linguagem de uso geral, com tipagem dinâmica e forte, orientada a objetos e que incorpora diversos paradigmas de programação, como o funcional e o imperativo.

Iniciantes

  • Ruby in Twenty Minutes - É o que o nome diz: um pequeno tutorial que promete não tomar mais do que 20 minutos do seu tempo. Se encarrega de mostrar como baixar e instalar o Ruby. Faz grande uso da IRB (Int
@raelgc
raelgc / Email Server (Linux, Unix, Mac).md
Last active May 21, 2024 11:31
Setup a Local Only SMTP Email Server (Linux, Unix, Mac)

Setup a Local Only SMTP Email Server (Linux, Unix, Mac)

1 - Point localhost.com to your machine

Most of programs will not accept an email using just @localhost as domain. So, edit /etc/hosts file to make the domain localhost.com point to your machine, including this content to the file:

127.0.0.1 localhost.com

2 - Install Postfix

@nazgob
nazgob / ctags.setup
Created January 6, 2012 13:44
ctags setup on mac
# you have ctags but it does not work...
$ ctags -R --exclude=.git --exclude=log *
ctags: illegal option -- R
usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
#you need to get new ctags, i recommend homebrew but anything will work
$ brew install ctags
#alias ctags if you used homebrew
$ alias ctags="`brew --prefix`/bin/ctags"
@thegeekyasian
thegeekyasian / HttpRequestLoggingFilter.java
Created February 25, 2020 10:58
Spring Boot HttpServletRequest Logging Filter. A Request Logging Filter for Spring Boot applications, that allows you to read the request body multiple times. The request body is cached using an overridden HttpServletRequestWrapper. Then a reader that allows the client to read the body multiple times is returned.
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.util.StreamUtils;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import java.io.*;
import java.util.*;
@lohenyumnam
lohenyumnam / How to use CoreLocation in iOS using Swift 4.swift
Last active May 21, 2024 11:26
How to use CoreLocation in iOS using Swift 4 to get your location Speed, Floor, timestamp, Course Direction, Altitude above sea level
// How to use CoreLocation to get your location Speed, Floor, timestamp, Course Direction, Altitude above sea level
//TODO: Step 1 ####################################################################
// First of all import "CoreLocation"
import CoreLocation
//TODO: Step 2 ####################################################################

E DAJE

Ci hai creduto davvero???? Ma io che ne so'!!!

Se lo sapevo lo dicevo a te???

Se hai cliccato lascia un TUO commento nel muro della vergogna

@ruanbekker
ruanbekker / docker-nfs-volumes.md
Created December 10, 2017 10:43
NFS Volumes with Docker Swarm

Create NFS Volumes:

Creating the NFS Volume:

$ docker volume create --driver local \
  --opt type=nfs \
  --opt o=addr=192.168.1.115,uid=1000,gid=1000,rw \
  --opt device=:/mnt/volumes/mysql-test \
  mysql-test-1
@wojteklu
wojteklu / clean_code.md
Last active May 21, 2024 11:23
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@mwaskom
mwaskom / replacing_seaborn_distplot.ipynb
Last active May 21, 2024 11:22
A guide to replacing the deprecated `seaborn.distplot` function.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@silicakes
silicakes / zellij_sessionizer
Last active May 21, 2024 11:22
zellij_sessionizer
#!/usr/bin/env bash
# Inspired by https://github.com/ThePrimeagen/.dotfiles/blob/602019e902634188ab06ea31251c01c1a43d1621/bin/.local/scripts/tmux-sessionizer
# Just for zellij
# alows you to use `fzf` to navigate into a desire folder and either start or attach into a zellij session
# If you run it from inside zellij, it will open the newly selected folder in a new pane
# Demo of the original: https://youtu.be/bdumjiHabhQ?t=269
# 1. Place the script in your path