This file contains hidden or 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
# Note: VAT identification numbers for Greece use "EL", not "GR". | |
COUNTRY_CODES_EU = %w[ | |
AT BE BG CY CZ DK EE FI FR DE GR HU IE IT | |
LV LT LU MT NL PL PT RO SK SI ES SE GB | |
] |
This file contains hidden or 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
// Package main is a sample macOS-app-bundling program to demonstrate how to | |
// automate the process described in this tutorial: | |
// | |
// https://medium.com/@mattholt/packaging-a-go-application-for-macos-f7084b00f6b5 | |
// | |
// Bundling the .app is the first thing it does, and creating the DMG is the | |
// second. Making the DMG is optional, and is only done if you provide | |
// the template DMG file, which you have to create beforehand. | |
// | |
// Example use: |
This file contains hidden or 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
# Copy this snippet below and paste into a terminal to download the HTML file | |
# and open it in your default browser | |
tmp=$(mktemp /tmp/keygen-XXXXXX) && \ | |
curl -o "$tmp" https://gist.githubusercontent.com/ezekg/0f87abd27e60be3ffeef02c7c2829319/raw/97b71eb58dcd85383a4c8fccb8ce38c887e0eacb/index.html && \ | |
open "$tmp" |
This file contains hidden or 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
const fetch = require('node-fetch') | |
const NodeRSA = require('node-rsa') | |
const crypto = require('crypto') | |
const now = new Date() | |
// The policy we want to use for generated licenses, as well as the | |
// user the license is for. Feel free to omit the user. | |
const POLICY_ID = '3bc8bc4c-78fd-4d8b-89dd-f4d2cda1d353' | |
const USER_ID = '4796e950-0dcf-4bab-9443-8b406889356f' |
This file contains hidden or 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
# 1. Generate a public/private keypair | |
openssl genrsa -out priv.pem 512 | |
openssl rsa -in priv.pem -out pub.pem -outform PEM -pubout | |
# 2. Verify public/private keys look OK | |
cat priv.pem pub.pem | |
# 3. Generate a key with an expiry in 1 year and sign with *private* key (server-side) | |
# | |
# Note: the expiry you choose should match your license's policy, so that online |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset='UTF-8'> | |
<title>Node-locked License Validation Example</title> | |
</head> | |
<body> | |
<button type='button' id='validate-license'> | |
Validate License | |
</button> |
This file contains hidden or 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
using RestSharp; | |
using System; | |
using System.Collections.Generic; | |
public class Example | |
{ | |
// This is your Keygen account ID or slug. | |
// | |
// Available at: https://app.keygen.sh/settings | |
const string KEYGEN_ACCOUNT_ID = "YOUR_KEYGEN_ACCOUNT_ID"; |
This file contains hidden or 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
// Set your Stripe API key. Remember to change this to your live secret key in production. | |
// | |
// NEVER USE YOUR SECRET KEY IN CLIENT-SIDE CODE. | |
// | |
// See your keys here: https://dashboard.stripe.com/account/apikeys | |
StripeConfiguration.SetApiKey("YOUR_STRIPE_SECRET_KEY"); | |
using RestSharp; | |
using System; | |
using System.Collections.Generic; |
This file contains hidden or 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
# Install the 'node-fetch' library | |
npm install node-fetch | |
# Run the script by providing the required environment vars | |
KEYGEN_PRODUCT_TOKEN='' KEYGEN_ACCOUNT_ID='' KEYGEN_POLICY_ID='' ./import.js |
This file contains hidden or 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
using RestSharp; | |
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
public class Example | |
{ | |
// This is your account ID or slug. | |
// | |
// Available at: https://app.keygen.sh/settings |