This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:convert'; | |
import 'dart:io'; | |
import 'package:http/http.dart'; | |
class Place { | |
String streetNumber; | |
String street; | |
String city; | |
String zipCode; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
final ScrollController _scrollController = ScrollController(); | |
@override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ConfigureServices | |
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddCors(); | |
services.AddControllersWithViews(); | |
services.AddControllers(); | |
services.AddDbContextPool<AppIdentityDbContext>(options => options | |
// Configure the context to use MySQL Server. |
NewerOlder