Skip to content

Instantly share code, notes, and snippets.

@Fire-Frog
Fire-Frog / mock_boto3.py
Last active December 13, 2024 19:48
MagicMock any "service" for boto3 client
from unittest.mock import MagicMock
# both of the next imports are optional;
# they are used for this example only, but thet could be very well what you need to use
import csv
import io
# our custom "client" simulating the "boto3.client" call
def mock_boto3_client(service_name, *args, **kwargs):
# any service could be added here, just as long you create the custom mocked class for it
services = {

Configure ddclient with Namecheap

Namecheap Configuration

  1. Click the Manage button next to the domain in the Domain List view
  2. In the Domain tab, scroll down and remove any entries in the Redirect Domain list
  3. In the Advanced DNS tab...
  4. Turn on Dynamic DNS and make a note of the password
  5. Add an A Record for @ pointing to 127.0.0.1
function getDecimalFromBinary(strNumber) {
if (strNumber == null) {
console.log("Input must be an string.")
return false;
}
let stringTrimmed = strNumber.trim();
let regexBinary = /^(\d[0-1]*)$/;
let regexResult = regexBinary.test(stringTrimmed);
if (!regexResult) {
@Fire-Frog
Fire-Frog / irc.md
Created January 20, 2020 17:26 — forked from xero/irc.md
irc cheat sheet

#IRC Reference

Not intended as a guide for newbies, more like a "cheat sheet" for the somewhat experienced IRC user, especially one who wields some power over a channel.

##The Basics

  • /join #channel
    • Joins the specified channel.
  • /part #channel
    • Leaves the specified channel.
@Fire-Frog
Fire-Frog / client.js
Last active January 10, 2020 18:42
chat :D
const io = require("socket.io-client");
const socket = io("http://localhost:3000/default-room", {
path: "/chat",
autoConnect: true
});
socket.on("connect", function () {
socket.emit("testEvent", "asdf");