Skip to content

Instantly share code, notes, and snippets.

View ennerperez's full-sized avatar
💭
If Coffee Then Code

Enner Pérez ennerperez

💭
If Coffee Then Code
View GitHub Profile
@ennerperez
ennerperez / mssql_db_size.sql
Last active December 7, 2022 15:51
Database Sizes
declare @tableName varchar(255) = ''
declare @avgRows bigint = (
select
AVG(p.rows)
FROM
sys.tables t
INNER JOIN
sys.indexes i ON t.OBJECT_ID = i.object_id
INNER JOIN
sys.partitions p ON i.object_id = p.OBJECT_ID AND i.index_id = p.index_id
@ennerperez
ennerperez / Xamarin.Android.Linux.md
Created December 6, 2021 06:14
Install Xamarin Android for Linux

Please note that Xamarin.Android on Linux is officially unsupported. However, it is possible to manually install Xamarin.Android and configure Rider so that it can build and run Xamarin.Android apps on Linux. This guide has been tested on Ubuntu 16.04.

Install the latest stable Mono

See http://www.mono-project.com/download/

sudo apt-key adv –keyserver hkp://keyserver.ubuntu.com:80 –recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/ubuntu xenial main" | sudo tee /etc/apt/sources.list.d/mono-official.list
sudo apt-get update
@ennerperez
ennerperez / bitbucket-pipeline-ftp.yml
Last active December 1, 2021 19:04
Laravel bitbucket-pipeline.yml using FTP
image: php:7.4-fpm
pipelines:
branches:
master:
- step:
caches:
- node
name: Production
deployment: production
@ennerperez
ennerperez / bitbucket-pipeline-ssh.yml
Last active December 1, 2021 19:03
Laravel bitbucket-pipeline.yml using SSH
image: php:7.4-fpm
pipelines:
branches:
master:
- step:
caches:
- node
name: Production
deployment: Production
using System.Net;
using HtmlAgilityPack;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
public static class Rates
{
@ennerperez
ennerperez / BlazorContextAccesor.cs
Created March 9, 2021 18:07
Blazor Context Accesor
//-----------------------
// Startup.cs
//-----------------------
public void ConfigureServices(IServiceCollection services)
{
//...
services.AddTransient<IUserAccessorService, UserAccessorService>();
//...
}
using Abstractions.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Query;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using Microsoft.EntityFrameworkCore.Query;
using Abstractions.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
namespace Persistence.Abstractions
{
@ennerperez
ennerperez / multilang_js.md
Last active June 5, 2020 07:44
Multilang simple HTML/JS

Json

language/en.json

{
    "home": "<b>Home</b>",
    "english": "English",
    "spanish": "Spanish"
}

language/es.json

@ennerperez
ennerperez / mssql_ldf_clear.sql
Created March 25, 2020 17:23
Limpiador LDF
USE master
print '*****************************************'
print '*********** Limpiador LDF ***************'
print '*****************************************'
declare
@isql varchar(2000),
@dbname varchar(64),
@logfile varchar(128),