Skip to content

Instantly share code, notes, and snippets.

View neilgaietto's full-sized avatar
👁️‍🗨️

Neil Gaietto neilgaietto

👁️‍🗨️
View GitHub Profile
@neilgaietto
neilgaietto / interface-tests.ts
Last active July 28, 2021 11:49
Testing combining typescript interfaces
// base
export interface MyThing {
name: string;
}
// first type of calcs for base
export interface MyThingCalcA {
calcA: number;
}
@neilgaietto
neilgaietto / gist:5ac2919e631a083e8b342b0f67ab5655
Created July 25, 2021 12:55
Upgrade npm packages by package name
# Using NPM
npx npm-check-updates -i '/@?aws-amplify/' && npm update
@neilgaietto
neilgaietto / gist:0e73043d38653c98e366897c13e7e333
Created August 30, 2020 21:53
gitlab CI for deploying a quasar app to gitlab
Copied from Quasar Discord
gitlab CI for deploying a quasar app to gitlab
# Modified from https://knasmueller.net/vue-js-on-gitlab-pages
pages:
image: node:latest
stage: deploy
script:
- npm install -g @quasar/cli
- npm install --progress=false
@neilgaietto
neilgaietto / wp-launch-script.sh
Last active May 24, 2020 20:57
Increase AWS Lightsail Bitnami Wordpress Upload Size
echo "upload_max_filesize = \"250M\"" >> ~/apps/wordpress/htdocs/.user.ini
echo "post_max_size = \"250M\"" >> ~/apps/wordpress/htdocs/.user.ini
sudo /opt/bitnami/apps/wordpress/bnconfig --disable_banner 1
@neilgaietto
neilgaietto / Example.cs
Created October 4, 2019 17:50
WSS: SOAP Message Security Header for .NET
public class Example
{
public WebServiceResponseObject CallWebService()
{
var client = new YourWebserviceClient();
try
{
client.Open();
@neilgaietto
neilgaietto / EFExtensions.cs
Last active July 18, 2018 20:36 — forked from ondravondra/EFExtensions.cs
C# extension for executing Async upsert (MERGE SQL command) in EF with MSSQL. Multi Column keys support
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Text;
namespace EFExtensions
@neilgaietto
neilgaietto / DateTimeUtilities.cs
Created March 1, 2018 20:08
DateTime Utilities
/// <summary>
/// DateTime for EST
/// </summary>
/// <returns>EST</returns>
public static DateTime LocalDateTime()
{
var timeUtc = DateTime.UtcNow;
DateTime easternTime = TimeZoneInfo.ConvertTimeFromUtc(timeUtc, EasternTimeZone());
return easternTime;
}
@neilgaietto
neilgaietto / AppAssemblies.cs
Created December 16, 2016 15:41
Registering all profiles for Automapper
//Searches solution for all assemblies
public static class AppAssemblies
{
public static IEnumerable<Assembly> AsEnumerable()
{
string baseDirectory = AppDomain.CurrentDomain.BaseDirectory;
foreach (Assembly assembly in Directory.GetFiles(baseDirectory)
.Where(x => Path.GetExtension(x).Equals(".dll", StringComparison.OrdinalIgnoreCase))
.Select(Assembly.LoadFrom))
{
@neilgaietto
neilgaietto / GrayLogAppender.cs
Created December 9, 2016 15:51
Umbraco GrayLog Appender
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using AtlanticBT.Core.Logging;
using AtlanticBT.Core.Logging.Models;
using log4net.Appender;
using log4net.Core;
@neilgaietto
neilgaietto / CustomRules.js
Last active December 14, 2016 14:31
Mock "CloudFront-Viewer-Country" via Fiddler2
// Snippet of what needs added to the Fiddler2 script to add a fake CloudFront-Viewer-Country value on all requests.
// The "..."'s indicate hidden code to highlight what needs added.
// This is for testing locally.
class Handlers
{
...
// Create CloudFront-Viewer-Country header setting in "Rules" main nav