Skip to content

Instantly share code, notes, and snippets.

View silnose's full-sized avatar
🏠
Working from home

Silvana Murgo silnose

🏠
Working from home
View GitHub Profile
@silnose
silnose / file-size.pipe.ts
Created December 31, 2020 04:32 — forked from JonCatmull/file-size.pipe.ts
Angular2 + TypeScript file size Pipe/Filter. Convert bytes into largest possible unit. e.g. 1024 => 1 KB
/**
* @license
* Copyright (c) 2019 Jonathan Catmull.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
@silnose
silnose / clean_code.md
Created December 14, 2020 02:15 — forked from wojteklu/clean_code.md
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

@silnose
silnose / gist:b788ee3683db8571afd30a9e2d8e2c96
Created October 31, 2018 13:33 — forked from guilherme/gist:9604324
Git pre-commit hook that detects if the developer forget to remove all the javascript console.log before commit.
#!/bin/sh
# Redirect output to stderr.
exec 1>&2
# enable user input
exec < /dev/tty
consoleregexp='console.log'
# CHECK
if test $(git diff --cached | grep $consoleregexp | wc -l) != 0
then
@silnose
silnose / readme.md
Created January 10, 2017 18:02
ASP.NET MVC manejo de errores/paginas personalizadas

Se debe iniciar por aclarar que MVC es un HttpHandler conectado al pipeline de asp.net, y, asp.net, es un framework para manejar peticiones, casi siempre dentro de IIS. IIS -> ASP.NET -> MVC Por eso hay tantos lugares donde se pueden manejar los errores, de adentro (MVC) hacía afuera (IIS) podemos listar los siguientes:

  • HandleErrorAttribute
  • Controller.OnException Method
  • Application_Error event
  • customErrors element (web.config)
  • httpErrors element (web.config)
  • Custom HttpModule
@silnose
silnose / gist:eb41bf92ee582b6d6e272c7a1e63eb98
Created October 5, 2016 14:58 — forked from danielestevez/gist:2044589
GIT Commit to an existing Tag
1) Create a branch with the tag
git branch {tagname}-branch {tagname}
git checkout {tagname}-branch
2) Include the fix manually if it's just a change ....
git add .
git ci -m "Fix included"
or cherry-pick the commit, whatever is easier
git cherry-pick {num_commit}
@silnose
silnose / setup_selenium.sh
Created September 2, 2016 15:34 — forked from curtismcmullan/setup_selenium.sh
Setup Selenium Server on Ubuntu 14.04
#!/bin/bash
# Following the guide found at this page
# http://programmingarehard.com/2014/03/17/behat-and-selenium-in-vagrant.html
echo "\r\nUpdating system ...\r\n"
sudo apt-get update
# Create folder to place selenium in
@silnose
silnose / Controller.php
Created August 9, 2016 21:18 — forked from milon/Controller.php
Delete Modal Popup with Laravel, Bootstrap and jQuery
public function index(){
$categoryList = Category::all();
return view('category.list')->with('categoryList', $categoryList);
}