Skip to content

Instantly share code, notes, and snippets.

View natelowry's full-sized avatar
:shipit:

Nate Lowry natelowry

:shipit:
View GitHub Profile
/*jshint esversion: 6 */
const exiftool = require("exiftool-vendored").exiftool; //yarn add exiftool-vendored
const gpxParser = require("gpxparser"); //yarn add gpxparser
const fs = require("fs");
var gpx = new gpxParser();
gpx.parse(fs.readFileSync("c:/data/Geo.gpx"));
var mainTrack = gpx.tracks[0];
@natelowry
natelowry / ImageToGrayscale.swift
Last active August 2, 2021 01:22 — forked from vlondon/ImageToGrayscale.swift
Convert UIImage to grayscale
func convertImageToGrayScale(image: UIImage) -> UIImage {
// Create image rectangle with current image width/height
let imageRect = CGRect(x: 0, y: 0, width: image.size.width, height: image.size.height)
// Grayscale color space
let colorSpace = CGColorSpaceCreateDeviceGray()
// Create bitmap content with current image size and grayscale colorspace
let context = CGContext(data: nil, width: Int(image.size.width), height: Int(image.size.height), bitsPerComponent: 8, bytesPerRow: 0, space: colorSpace, bitmapInfo: CGImageAlphaInfo.none.rawValue)!
@natelowry
natelowry / <Custom>DbContext.cs
Last active November 11, 2019 15:48 — forked from werwolfby/<Custom>DbContext.cs
EF Core DateTime Utc kind
public class CustomDbContext : DbContext
{
// ...
protected override void OnConfiguring(DbContextOptionsBuilder options)
{
// Replace default materializer source to custom, to convert DateTimes
options.ReplaceService<IEntityMaterializerSource, DateTimeKindEntityMaterializerSource>();
base.OnConfiguring(options);
@natelowry
natelowry / VS2017-perf-tricks.md
Last active April 18, 2018 21:18
VS 2017 performance tricks

Step 1: make sure you've got the latest version (15.5.1 at the time of this writing)

Disable the performance profiling/tooling (sry, no screenshot)

Disable JS debugging:

image

Disable ESLint:

@natelowry
natelowry / pre-push
Last active December 6, 2017 21:08
Don't push to master on Windows (put these in .git/hooks/)
#!C:/Program\ Files/Git/usr/bin/sh.exe
exec powershell.exe -NoProfile -ExecutionPolicy Bypass -File ".\.git\hooks\pre-push.ps1"
@natelowry
natelowry / certify.ps1
Last active October 11, 2016 20:57
SSL to AWS helper
# This script does most of the certificate gynmastics needed to get an SSL certificate on a classic AWS EC2 ELB (Amazon load balancer)
# See http://dontpaniclabs.com/blog/post/2015/09/08/getting-ssl-certificates-on-aws-elastic-load-balancers-in-windows/
#
# NOTE: This script assumes you have openssl installed (https://slproweb.com/products/Win32OpenSSL.html).
# It also assumes that your certificate file is called 'cert.pfx' and that the export password on your certificate is 'password'.
#
Write-Host "Starting certificate gymnastics"
Write-Host "Starting extracting server key"
### Keybase proof
I hereby claim:
* I am natelowry on github.
* I am natelowry (https://keybase.io/natelowry) on keybase.
* I have a public key whose fingerprint is 8D30 27E4 1D58 2929 FDAA 03A2 2965 3988 8479 592E
To claim this, I am signing this object:
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
namespace DynamicSplashScreen
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
int thisIsAVariable = 3;
public double ReturnSomething(double[] arr){
arr[0] = 1.0f;
var myVar = string.Empty;
return arr[2];
}