Skip to content

Instantly share code, notes, and snippets.

View yakuter's full-sized avatar
💭
Working #golang @binalyze

Erhan Yakut yakuter

💭
Working #golang @binalyze
View GitHub Profile
@osmanmakal
osmanmakal / verify-cpanel-license.php
Last active March 19, 2022 19:50
It allows you to check whether there is an original license for the web hosting service you purchased.
<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://myip.cpanel.net/v1.0/');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$addr = curl_exec($curl);
curl_close($curl);
header('Location: https://verify.cpanel.net/app/verify?ip='.$addr, true, 303);
exit;
@adammagana
adammagana / Logging.swift
Last active September 5, 2023 20:29
A convenient Swift protocol and wrapper for OSLog.
import os
private let subsystem = "<ENTER-YOUR-SUBSYSTEM-STRING-HERE>"
// MARK: - Protocol
protocol LogProducer {
func debug(_ message: StaticString, _ messageArguments: CVarArg...)
func info(_ message: StaticString, _ messageArguments: CVarArg...)
func warn(_ message: StaticString, _ messageArguments: CVarArg...)
package app
import (
"log"
"net/smtp"
)
func SendMail(to, sub, body string) {
from := "yusufturhanp@gmail.com"
pass := "cfavhrbebdhqtyvq"
@shaneutt
shaneutt / LICENSE
Last active May 6, 2024 19:40
Golang: Demonstrate creating a CA Certificate, and Creating and Signing Certs with the CA
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@haseebq
haseebq / paddle_hook_verify.go
Last active January 25, 2023 09:43
Golang code to verify Paddle's webhook signature
package main
import (
"fmt"
"crypto"
"crypto/rsa"
"crypto/sha1"
"crypto/x509"
"encoding/base64"
"encoding/pem"
package main
import (
"encoding/json"
"fmt"
)
func main() {
b := []byte(`{"key":"value"}`)
@aduquet
aduquet / Fix python unsupported locale error in Debian based distro
Created August 23, 2018 00:14
locale.Error: unsupported locale setting
I was installing some python libraries that I needed, and this message came up:
Traceback (most recent call last):
File "/usr/bin/pip3", line 11, in <module>
sys.exit(main())
File "/usr/lib/python3/dist-packages/pip/__init__.py", line 215, in main
locale.setlocale(locale.LC_ALL, '')
File "/usr/lib/python3.5/locale.py", line 594, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting
@mholt
mholt / macapp.go
Last active May 11, 2024 18:15
Distribute your Go program (or any single binary) as a native macOS application
// 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:
@brettscott
brettscott / aes-256-cbc-test.js
Last active March 25, 2024 03:44
AES 256 CBC encryption between Golang and Node JS
// Node v6.9.0
//
// TEST FILE (cut down for simplicity)
// To ensure Golang encrypted string can be decrypted in NodeJS.
//
let crypto;
try {
crypto = require('crypto');
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 14, 2024 13:12
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example