Skip to content

Instantly share code, notes, and snippets.

View benjamintemitope's full-sized avatar
🎯
Focusing

Benjamin Franklin benjamintemitope

🎯
Focusing
View GitHub Profile
@aursu
aursu / modem.py
Last active June 27, 2022 03:16
ModemManager interface via Python 3 (Dbus, Modems, SMS)
#!/usr/bin/python3
# script created for reading SMS messages from 3G modem connected to PC
# 1) it looks for modem
# 2) reads all SMS messages from modem
# 3) prints all found SMS messages to stdout only if total messages count
# greater than SMS_STORE_COUNT (default is 3)
# 4) save all but SMS_STORE_COUNT messages to txt files and
# delete them from modem
@jtiebel
jtiebel / index.html
Created May 25, 2019 17:09
List.js with Multiple Filters, Search, and Pagination
<div class="container">
<div class="row">
<div id="users" class="col-xs-12">
<div class="filter-group row">
<div class="form-group col-xs-12 col-sm-12 col-md-4">
<input type="text" class="search form-control" placeholder="Search" />
</div>
<div class="form-group col-xs-12 col-sm-12 col-md-4">
<div class="radio-inline">
<label>
@echr
echr / Whatsapp Botman Driver
Last active May 29, 2023 13:37
Simple Botman Whatsapp Driver
<?php
namespace Drivers\Whatsapp;
use BotMan\BotMan\Exceptions\Base\DriverException;
class WhatsappConnectionException extends DriverException
{
}
@markjaquith
markjaquith / Laracon US 2023.md
Created July 20, 2023 21:29
Rough notes from Laracon US 2023

These notes are super rough, and I didn’t take notes for a couple sessions. Let me know if you found them useful or they helped you remember things presented at the conference! @markjaquith on Twitter.

Pest PHP

by Nuno Maduro

[!question] How do snapshots work in CI? Won’t there not be an existing snapshot when the tests run?

Cool new features

@seayxu
seayxu / Bootstrap Checkbox Select All Or Cancel
Last active August 19, 2023 05:12
Bootstrap Checkbox Select All Or Cancel
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Bootstrap Table Checkbox Select All and Cancel</title>
<link href="//cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<h2>Bootstrap Table Checkbox Select All and Cancel</h2>
<table class="table table-striped">
@lysender
lysender / htmx-allow-400-errors-swap-for-validation-errors.md
Created August 19, 2023 13:49
HTMX - Allow HTTP error 400 and 422 swap content to enable showing validation errors

Still a newbie to HTMX.

I was writing some form submit interaction and realized that HTMX won't swap/render if the HTTP status code is not 2xx.

For 404, 500 or 503 errors, I think it's fair enough.

For my use case, I'm returning error 400 or 422 for validation errors. I'm returning the form back with some error decorations for example.

According to the docs, I can change that behavior.

@peter-mcconnell
peter-mcconnell / singularize.php
Created March 25, 2014 08:48
PHP singularize
<?php
/**
* Singularize a string.
* Converts a word to english singular form.
*
* Usage example:
* {singularize "people"} # person
*/
function singularize ($params)
{
@zed-dz
zed-dz / offline_mdn_docs.md
Created March 12, 2019 14:01
Offline MDN Docs
@sohelamin
sohelamin / laravel-related-posts.php
Created December 3, 2015 11:31
Related posts in Laravel
@mariodian
mariodian / zte-sms-forwarder.sh
Last active December 26, 2023 04:52
ZTE 3G/4G Modem SMS Forwarder
#!/bin/bash
PUSHOVER_TOKEN="<token>"
PUSHOVER_USER="<user>"
# The list of blocked keywords
declare -a BLOCKED=("uber eats" "block another keyword")
URL=http://192.168.0.1
REFERER="$URL/index.html"
URL_SET="$URL/goform/goform_set_cmd_process"