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 / gist:603af0ff12bbff80ccdcd2962e633081
Created June 24, 2022 15:56
RE-Install NODE-NODEJS in Ubuntu to fix issue => Version 'not found - try `nvm ls-remote --lts` to browse available versions.
sudo apt-get remove nodejs ^node-* nodejs-*
sudo apt-get autoremove
sudo apt-get clean
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install nodejs
curl https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | sh
npm --version //check version
#!/bin/sh
# Step 1: nano post-checkout
# Step 2: copy paste this file
# Step 3: save this file
# Step 4: chmod +x .git/hooks/post-checkout
npm install
#!/bin/sh
# Step 1: nano pre-commit
# Step 2: copy paste this file
# Step 3: save this file
# Step 4: chmod +x .git/hooks/pre-commit
# To avoid this: git commit -m "..." --no-verify
ng test
ng lint
@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 / PMAlertControllerCustomAlert.swift
Created July 3, 2019 03:40
Custom PMAlertController
func showAlert(_ title: String, message: String, buttonTitle: String, headerImage: UIImage? = nil, completion: @escaping () -> ()){
let alertVC = PMAlertController(title: title, description: message, image: headerImage, style: .alert)
alertVC.view.layer.cornerRadius = 10
alertVC.alertMaskBackground.backgroundColor = UIColor.black
alertVC.alertMaskBackground.alpha = 0.3
alertVC.alertTitle.textColor = UIColor(named: MDA3.Colors.darkGreyBlue)
alertVC.alertTitle.font = UIFont(name: "Poppins-Bold", size: 22.0)
alertVC.alertDescription.font = UIFont(name: "Roboto-Bold", size: 12.0)
alertVC.alertDescription.textColor = UIColor(named: MDA3.Colors.darkGreyBlue)
@silnose
silnose / SwiftBabySteps.swift
Last active May 3, 2019 20:22
Swift Baby Steps
import Foundation
//VARIABLES
var hiVar:String = "holis word"
//CONVERT VARIABLES
var numberVar:Int = 100
var hiNumberVar = hiVar + String(numberVar)
print(hiNumberVar)
@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 / gist:ccd957ed756ad841b52da2e45ced393b
Created April 27, 2018 16:28
Parcial View in Boostrap 4 Modal
#Layout#
<a data-toggle="modal" data-target=".data-api" href="@Url.Action("GetParcial", "Controller")" class=" mr-3 font-color-medium">OPEN REMOTE MODAL</a>
<div class="modal fade remote-modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
<div class="modal-content">
</div>
</div>
@silnose
silnose / HtmlHelperExtensions.cs
Created March 20, 2018 04:24
Inlining CSS Bundles with ASP.NET MVC
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Optimization;
public static class HtmlHelperExtensions
{
public static IHtmlString InlineStyles(this HtmlHelper htmlHelper, string bundleVirtualPath)
{
return htmlHelper.InlineBundle(bundleVirtualPath, htmlTagName: "style");