Skip to content

Instantly share code, notes, and snippets.

@myildizCH
myildizCH / adapter-pattern.ts
Created July 25, 2023 15:47
Adapter Pattern TypeScript
// Step 1: Define the Interface our System Expects
interface IMessageClient {
sendMessage(channel: string, user: string, message: string): void;
}
// Step 2: Implement Slack Client (Adaptee)
class SlackClient {
postMessageToUserInChannel(channel: string, user: string, message: string) {
console.log(`Posting message to ${user} in ${channel} through Slack: ${message}`);
}
@bmaupin
bmaupin / free-database-hosting.md
Last active May 14, 2024 15:04
Free database hosting
@skrilladeville
skrilladeville / file.rb
Created May 3, 2013 07:04
Free Web Hosting with PHP, MySQL and cPanel, No Ads
http://www.000webhost.com/
@jmmauricio
jmmauricio / pf_ds_py_run_save_9bus_sys
Created June 13, 2015 18:41
PowerFactory DigSILENT Python Script to load flow, set variables to save, set event, initialize, run and save results to a txt file
import sys
sys.path.append(r"C:\DigSILENT15p1p7\python")
# import PowerFactory module
import powerfactory
# start PowerFactory in engine mode
app = powerfactory.GetApplication()
user = app.GetCurrentUser()
@shaneutt
shaneutt / LICENSE
Last active May 14, 2024 15:02
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
@phortuin
phortuin / signing-git-commits.md
Last active May 14, 2024 15:02
Set up a GPG key for signing Git commits on MacOS (M1)

Based on this blogpost.

To sign Git commits, you need a gpg key. GPG stands for GNU Privacy Guard and is the de facto implementation of the OpenPGP message format. PGP stands for ‘Pretty Good Privacy’ and is a standard to sign and encrypt messages.

Setting up

Install with Homebrew:

$ brew install gpg
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from time import sleep
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.common.by import By
import pathlib
import warnings
# import pyttsx3
import speech_recognition as sr
@adrianhajdin
adrianhajdin / App.css
Last active May 14, 2024 15:01
Build and Deploy a Full Stack Realtime Chat Messaging App with Authentication & SMS Notifications
:root {
--primary-color: #005fff;
--primary-color-alpha: #005fff1a;
}
html,
body {
margin: 0;
padding: 0;
height: 100%;
@mrl22
mrl22 / TimeHelper.php
Created October 23, 2023 16:31
Laravel / PHP / Carbon - Round time to the nearest X minutes.
<?php
namespace App\Helpers;
use Carbon\Carbon;
class TimeHelper
{
public static function round($time = null, $nearestMinutes = 15)
@v1mkss
v1mkss / JetBrains Activation.md
Last active May 14, 2024 15:01
JetBrains Activation

JetBrains Activation

  • No proxy for:
*.apache.org, *.github.com, *.github.io, *.githubusercontent.com, *.gitlab.com, *.google.com, *.gradle.org, *.jetbrains.space, *.maven.org, *.micronaut.io, *.quarkus.io, *.spring.io, cache-redirector.jetbrains.com, cloudconfig.jetbrains.com, download-cdn.jetbrains.com, download.jetbrains.com, downloads.marketplace.jetbrains.com, ea-report.jetbrains.com, github.com, gitlab.com, google.com, gradle.org, jcenter.bintray.com, micronaut.io, plugins.jetbrains.com, quarkus.io, resources.jetbrains.com, spring.io, www.jetbrains.com

Activation Key:

UX394X3HLT-eyJsaWNlbnNlSWQiOiJVWDM5NFgzSExUIiwibGljZW5zZWVOYW1lIjoiSG9uZ2lrIFVuaXZlcnNpdHntmY3snbXrjIDtlZnqtZAiLCJsaWNlbnNlZVR5cGUiOiJDTEFTU1JPT00iLCJhc3NpZ25lZU5hbWUiOiLkvJfliJvkupEg5bel5L2c5a6kIiwiYXNzaWduZWVFbWFpbCI6ImhhbmF6YXdhbWl0b0BnbWFpbC5jb20iLCJsaWNlbnNlUmVzdHJpY3Rpb24iOiJGb3IgZWR1Y2F0aW9uYWwgdXNlIG9ubHkiLCJjaGVja0NvbmN1cnJlbnRVc2UiOmZhb