Skip to content

Instantly share code, notes, and snippets.

View donsn's full-sized avatar
🚀

Nwachukwu Daniel (DONSN) donsn

🚀
View GitHub Profile
@dphang
dphang / deployer.ts
Last active February 11, 2022 02:46
Deploy serverless-next.js to different stages
#!/usr/bin/env node
// Example (opinionated) configuration with yarn (I use TypeScript/Node environment, feel free to adapt this file to JS if needed). Note: I am running in Node 12.x environment with aws cli installed.
// 1. Copy this file to scripts/deployer.ts (or any other you prefer)
// 2. Add "deploy": "ts-node --project tsconfig.scripts.json scripts/deployer.ts deploy" to your package.json file
// 3. You may also need to install devDependencies like yargs, @types/node, @types/yargs, js-yaml, @types/js-yaml
// 4. I also add tsconfig.scripts.json like the following:
/*
{
@lastlink
lastlink / DatabaseTools.cs
Last active June 12, 2022 06:49
Entity Framework dotnet core database conversions. Triggers for on update, default datetime conversions for mssql, postgress, sqlite, and mysql
using Microsoft.EntityFrameworkCore.Metadata;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace ProjectNamespace.Api.Utils
{
public class DatabaseTools
{
public class DatabaseKeys
{
public string ValueGenerationStrategy;
@khellang
khellang / SpaFallbackException.cs
Last active November 1, 2022 07:30
Fallback middleware for SPA client-side routing
using System;
using System.Text;
using Microsoft.AspNetCore.Http;
namespace SpaFallback
{
public class SpaFallbackException : Exception
{
private const string Fallback = nameof(SpaFallbackExtensions.UseSpaFallback);

Note

Apple will reject apps that are using private url schemes (Ugh, Apple....) if they are pretty much obvius. Some apps are rejected and others are not, so, be aware of this issue before implementing any of those URL's in your app as a feature.

Updates

  • [UPDATE 4] iOS 10 update: apparently settings now can be reached using App-Pref instead of prefs
  • [UPDATE 3] For now you just can use url schemes to open your apps's settings with Swift 3.0 (Xcode 8). I'll keep you informed when OS preferences can be reached
  • [UPDATE 2] The openURL() method of UIApplication is now deprecated. You should use application(_:open:options:) instead
  • [UPDATE 1] Not yet tested in iOS 10. It will fail because of policies changes in URL scheme handling.
@noelboss
noelboss / git-deployment.md
Last active May 2, 2024 15:47
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.