Dependencies:
"Serilog.Settings.Configuration": "2.3.1",
"Serilog.Sinks.Literate": "2.1.0",
"Serilog.Extensions.Logging": "1.4.0"
Your Startup constructor:
/* | |
* Helper class for XTEA en/decryption of arbitrary data. | |
* | |
* Copyright (c) 2017, Henrik Heine | |
*/ | |
using System; | |
using System.IO; | |
using System.Text; |
Dependencies:
"Serilog.Settings.Configuration": "2.3.1",
"Serilog.Sinks.Literate": "2.1.0",
"Serilog.Extensions.Logging": "1.4.0"
Your Startup constructor:
In this demonstration I will show you how to read data in Angular2 final release before application startup. You can use it to read configuration files like you do in other languages like Java, Python, Ruby, Php.
This is how the demonstration will load data:
a) It will read an env file named 'env.json'. This file indicates what is the current working environment. Options are: 'production' and 'development';
b) It will read a config JSON file based on what is found in env file. If env is "production", the file is 'config.production.json'. If env is "development", the file is 'config.development.json'.
// OSX | |
open -na Google\ Chrome --args --disable-web-security --user-data-dir="/tmp/chrome_dev" |
<!-- | |
This disables app transport security and allows non-HTTPS requests. | |
Note: it is not recommended to use non-HTTPS requests for sensitive data. A better | |
approach is to fix the non-secure resources. However, this patch will work in a pinch. | |
To apply the fix in your Ionic/Cordova app, edit the file located here: | |
platforms/ios/MyApp/MyApp-Info.plist | |
And add this XML right before the end of the file inside of the last </dict> entry: |
using System.Collections.Generic; | |
using System.Web.Http; | |
using Newtonsoft.Json; | |
using Newtonsoft.Json.Converters; | |
using Newtonsoft.Json.Serialization; | |
using Owin; | |
using Swashbuckle.Application; | |
namespace Project | |
{ |
using System; | |
using System.Linq; | |
using System.Data; | |
using System.Data.SqlClient; | |
using System.Threading.Tasks; | |
using Dapper; | |
public class Program | |
{ | |
public static void Main() |
import Cocoa | |
@NSApplicationMain | |
class AppDelegate: NSObject, NSApplicationDelegate { | |
@IBOutlet weak var window: NSWindow! | |
@IBOutlet weak var imageView: NSImageView! | |
func applicationDidFinishLaunching(aNotification: NSNotification) { | |
self.imageView.image = convert(myImage()) |
This gist outlines how to resize a view when a keyboard appears using Auto Layout (there are a bunch of code samples out there that manually adjust the view's frame, but that's just so 2013). The method I outline below works universally on both iPhone and iPad, portrait and landscape, and is pretty darn simple.
The first thing to do is to define our containing view controller, the view, and the bottom constraint that we'll use to adjust its size.
Here's HeightAdjustingViewController.h. We don't need to expose any public properties, so it's pretty bare.
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');
Those suck for maintenance and they're ugly.