Skip to content

Instantly share code, notes, and snippets.

View jmptrader's full-sized avatar
🏠
Working from home

JM jmptrader

🏠
Working from home
View GitHub Profile
@jmptrader
jmptrader / csvfile.h
Created May 1, 2022 15:34 — forked from rudolfovich/csvfile.h
CSV file generator
#pragma once
#include <string>
#include <iostream>
#include <fstream>
#include <sstream>
class csvfile;
inline static csvfile& endrow(csvfile& file);
inline static csvfile& flush(csvfile& file);
@jmptrader
jmptrader / go-oci8 on win64.md
Created March 27, 2022 22:59 — forked from mnadel/go-oci8 on win64.md
go-oci8 on windows64
@jmptrader
jmptrader / Visual Studio solution file headers
Created February 22, 2022 18:05 — forked from sanjeev40084/Visual Studio solution file headers
Visual Studio solution file headers - 2003, 2005, 2008, 2010, 2012, 2013, 2015, 2017, 2019, 2022
== Visual Studio .NET 2003 (DO NOT COPY THIS LINE) ==
Microsoft Visual Studio Solution File, Format Version 8.00
# Visual Studio .NET 2003
VisualStudioVersion = 7.1
== Visual Studio 2005 (DO NOT COPY THIS LINE) ==
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
VisualStudioVersion = 8.0
@jmptrader
jmptrader / deepcopy.go
Created October 3, 2021 20:21 — forked from soroushjp/deepcopy.go
Golang: deepcopy map[string]interface{}. Could be used for any other Go type with minor modifications.
// Package deepcopy provides a function for deep copying map[string]interface{}
// values. Inspired by the StackOverflow answer at:
// http://stackoverflow.com/a/28579297/1366283
//
// Uses the golang.org/pkg/encoding/gob package to do this and therefore has the
// same caveats.
// See: https://blog.golang.org/gobs-of-data
// See: https://golang.org/pkg/encoding/gob/
package deepcopy
@jmptrader
jmptrader / redirectExample.go
Created May 19, 2021 05:25 — forked from knibals/redirectExample.go
How to redirect HTTP to HTTPS with a golang webserver.
package main
import (
"net/http"
)
func redirect(w http.ResponseWriter, req *http.Request) {
http.Redirect(w, req,
"https://" + req.Host + req.URL.String(),
http.StatusMovedPermanently)
}
@jmptrader
jmptrader / SSL.md
Created May 16, 2021 17:02 — forked from gangsta/SSL.md
How to Setting Up a Comodo SSL Cert

How to Setting Up a Comodo SSL Cert

  • I advice you to buy SSL Certs from officially Comodo only , or some SSL reseller whose you trust.

These are the steps I went through to set up an SSL cert. Purchase the cert

Prior to purchasing a cert, you need to generate a private key, and a CSR file (Certificate Signing Request). You’ll be asked for the content of the CSR file when ordering the certificate:

openssl req -new -newkey rsa:2048 -nodes -keyout example_com.key -out example_com.csr
@jmptrader
jmptrader / reader.go
Created September 9, 2020 07:27 — forked from jedy/reader.go
processes communicate with shared memory in golang
package main
// #include <stdlib.h>
// #include "wrapper.c"
import "C"
import "unsafe"
import "fmt"
func read(filename string) string {
f := C.CString(filename)
@jmptrader
jmptrader / golang-tls.md
Created August 31, 2020 21:02 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples

Moved to git repository: https://github.com/denji/golang-tls

Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@jmptrader
jmptrader / AppDelegate.cs
Created July 7, 2020 05:07 — forked from dannycabrera/AppDelegate.cs
Get notified when user takes screenshot on Xamarin.iOS
using Foundation;
using UIKit;
namespace YourApp
{
[Register ("AppDelegate")]
public partial class AppDelegate : UIApplicationDelegate
{
NSObject _screenshotNotification = null;