Skip to content

Instantly share code, notes, and snippets.

View mangowi's full-sized avatar
💪
C#, ASP.NET MVC, Core, Java and JavaScript(VueJS and React)

Daniel Mangowi mangowi

💪
C#, ASP.NET MVC, Core, Java and JavaScript(VueJS and React)
View GitHub Profile
@mangowi
mangowi / MyService.service
Created August 14, 2022 12:49 — forked from antoniocampos/MyService.service
.net Core Systemd Service Example (Linux autostart you .net app)
[Unit]
Description=MyService Description
[Service]
WorkingDirectory=/path/to/app/
ExecStart=/usr/bin/dotnet /path/to/app/App.dll
Restart=always
# Restart service after 10 seconds if the dotnet service crashes:
RestartSec=10
KillSignal=SIGINT
@mangowi
mangowi / html_email_buttons_1.html
Created September 7, 2021 07:37 — forked from elidickinson/html_email_buttons_1.html
HTML email buttons that work
<div>
<!--[if mso]>
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="http://www.EXAMPLE.com/" style="height:40px;v-text-anchor:middle;width:300px;" arcsize="10%" stroke="f" fillcolor="#d62828">
<w:anchorlock/>
<center style="color:#ffffff;font-family:sans-serif;font-size:16px;font-weight:bold;">
Button Text Here!
</center>
</v:roundrect>
<![endif]-->
<![if !mso]>
@mangowi
mangowi / CustomRequireHttpsFilter.cs
Created May 12, 2021 11:40 — forked from bjcull/CustomRequireHttpsFilter.cs
An improved HTTPS redirection filter for ASP.NET MVC.
public class CustomRequireHttpsFilter : RequireHttpsAttribute
{
protected override void HandleNonHttpsRequest(AuthorizationContext filterContext)
{
// The base only redirects GET, but we added HEAD as well. This avoids exceptions for bots crawling using HEAD.
// The other requests will throw an exception to ensure the correct verbs are used.
// We fall back to the base method as the mvc exceptions are marked as internal.
if (!String.Equals(filterContext.HttpContext.Request.HttpMethod, "GET", StringComparison.OrdinalIgnoreCase)
&& !String.Equals(filterContext.HttpContext.Request.HttpMethod, "HEAD", StringComparison.OrdinalIgnoreCase))
@mangowi
mangowi / async await ie11.js
Created February 19, 2021 10:46 — forked from DejanBelic/async await ie11.js
How to use async await in ie11
// Async await func
async function getTimelineData() {
var response = await fetch('/some-api-url')
return response.json()
}
async function populateTimelineInit() {
var data = await getTimelineData();
new vis.DataSet(data);
@mangowi
mangowi / ReadAndWritePlistFile.m
Created January 7, 2021 15:18 — forked from keitaito/ReadAndWritePlistFile.m
Read and Write Plist File in Objective-C, converted from Swift version written by Rebeloper http://rebeloper.com/read-write-plist-file-swift/
//
// ViewController.m
// ReadAndWritePlistFile
//
// Created by Keita on 3/3/15.
// Copyright (c) 2015 Keita Ito. All rights reserved.
// converted from Swift version written by Rebeloper http://rebeloper.com/read-write-plist-file-swift/
#import "ViewController.h"
import 'dart:convert';
import 'dart:io';
import 'package:http/http.dart';
class Place {
String streetNumber;
String street;
String city;
String zipCode;
@mangowi
mangowi / scrollbar_demo.dart
Created December 23, 2020 12:48 — forked from dhuma1981/scrollbar_demo.dart
Show scrollbar in ListView
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
final ScrollController _scrollController = ScrollController();
@override
@mangowi
mangowi / App.js
Created December 4, 2020 15:14 — forked from cruzach/App.js
import Constants from "expo-constants";
import * as Notifications from "expo-notifications";
import * as Permissions from "expo-permissions";
import React, { useState, useEffect, useRef } from "react";
import { Text, View, Button, Platform } from "react-native";
Notifications.setNotificationHandler({
handleNotification: async () => ({
shouldShowAlert: true,
shouldPlaySound: false,
@mangowi
mangowi / mailchimp-subscribe.coffee
Created July 10, 2020 14:34 — forked from chrsgrffth/mailchimp-subscribe.coffee
Vue – Mailchimp Subscribe Component
# To get the `action` prop:
#
# 1. Go to your dashboard on mailchimp.com and navigate
# to Lists > Signup Forms > Embedded Forms.
#
# 2. Copy the `<form>` action from the generated HTML code.
#
# 3. Pass that into the component via the prop, like so:
#
# <mailchimp-subscribe
@mangowi
mangowi / React-Native-WebView-Cookies.js
Created May 24, 2020 14:09 — forked from kanzitelli/React-Native-WebView-Cookies.js
React Native Trick: Get Cookies of WebView without using any native modules such as react-native-cookies. Might be helpful for getting JWT while making OAuth2 👽
// @flow
import React, { Component } from 'react';
import {
WebView,
} from 'react-native';
class LoginScreen extends Component {
state = {
cookies : {},