Skip to content

Instantly share code, notes, and snippets.

View felipebernardes's full-sized avatar
👋
Available for quick chats

Felipe Bernardes felipebernardes

👋
Available for quick chats
View GitHub Profile
const createLogger = (backgroundColor, color) => {
const logger = (message, ...args) => {
if (logger.enabled === false) {
return;
}
console.groupCollapsed(
`%c${message}`,
`background-color: ${backgroundColor}; color: ${color}; padding: 2px 4px;`,
...args
@rochacbruno
rochacbruno / a.md
Last active August 2, 2017 04:10
F12 to open anything

Use F12 to toggle visibility of any app, not only guake|yaquake

Save the toggle_visibility.sh in your home directory

$ chmod +x toggle_visibility.sh

go to XFCE -> settings -> Keyboard -> Application shortcuts (or equivalent in your window manager)

@fmasanori
fmasanori / Ordena Salarios USP.py
Last active May 22, 2021 18:59
Ordena Salários USP
#feito por https://twitter.com/guilhermeslcs
class Professor:
def __init__(self, nome, instituto, funcao, salario):
self.nome = nome
self.instituto = instituto
self.funcao = funcao
self.salario = salario
f = open("salarios.txt", "r")
@DariuszLuber
DariuszLuber / Webpack config for Sass+ES6+LiveReload.md
Last active July 29, 2022 10:10
Webpack + ES6 + Sass + Live reload

#Webpack + ES6 + Sass + Live reload

Basic example of webpack config to work with sass, es6 and live reload.

To get live reload working you need:

  • get package.json and webpack.config.js to your project foldee
  • run in terminal npm install
  • add this script <script src="http://localhost:35729/livereload.js"></script> to your index.html
  • create src folder and src files
  • run in terminal webpack

From zero to microservice with 𝚫 now

The following guide will show you how to deploy a simple microservice written in JavaScript using 𝚫 now.

It uses Open Source tools that are widely available, tested and understood:

  • Node.JS
  • NPM
  • Express
@Atlas7
Atlas7 / remove_postgres_on_mac_os.md
Last active March 23, 2023 13:02
Note - How completely uninstall PostgreSQL 9.X on Mac OSX

This blog post has helped me clean up my postgres development environment on Mac. So making a copy!

How completely uninstall PostgreSQL 9.X on Mac OSX

This article is referenced from stackoverflow:

If installed PostgreSQL with homebrew , enter brew uninstall postgresql

If you used the EnterpriseDB installer , follow the following step.
#include <stdio.h>
int main(void) {
int valor_saque = 0, nota100 = 0, nota50 = 0, nota20 = 0, nota10 = 0, resto100 = 0, resto50 = 0, resto20 = 0, resto10 = 0;
printf("Digite valor do saque: \n");
scanf("%d", &valor_saque);
if(valor_saque = "");
break;
@paulirish
paulirish / what-forces-layout.md
Last active November 15, 2024 16:45
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@JeffBelback
JeffBelback / docker-destroy-all.sh
Last active May 25, 2024 20:19
Destroy all Docker Containers and Images
#!/bin/bash
# Stop all containers
containers=`docker ps -a -q`
if [ -n "$containers" ] ; then
docker stop $containers
fi
# Delete all containers
containers=`docker ps -a -q`
if [ -n "$containers" ]; then
docker rm -f -v $containers
@rafaell-lycan
rafaell-lycan / prevent-enter-submit.js
Created January 28, 2015 22:28
AngularJS - Prevent Enter Submit Directive
angular.module('app',[])
.directive('preventEnterSubmit', function () {
return function (scope, el, attrs) {
el.bind('keydown', function (event) {
if (13 == event.which) {
event.preventDefault(); // Doesn't work at all
window.stop(); // Works in all browsers but IE...
document.execCommand('Stop'); // Works in IE
return false; // Don't even know why it's here. Does nothing.
}