Skip to content

Instantly share code, notes, and snippets.

View caendesilva's full-sized avatar
🎩
HydePHP.com

Caen De Silva caendesilva

🎩
HydePHP.com
View GitHub Profile
@caendesilva
caendesilva / tasty-foo-bar.txt
Created December 13, 2024 18:28
Foo, bar, and baz all have one problem: They're not tasty, and they're not alphabetical. Use this list instead.
Apple
Banana
Cherry
Date
Elderberry
Fig
Grape
Honeydew
Imbe
Jackfruit
@caendesilva
caendesilva / README.md
Last active October 24, 2024 20:00
A list of the 100 most common English words in various formats
<?php
// Function to extract city_ascii and country names
function extractLocationParts($filename) {
// Initialize an empty array to hold the merged location strings
$locations = [];
// Open the CSV file
if (($handle = fopen($filename, 'r')) !== false) {
// Get the header line
@caendesilva
caendesilva / phpf.php
Created October 5, 2024 12:24
PHP CLI Function Caller Script
#!/usr/bin/env php
<?php
if ($argc < 2) {
echo "Usage: phpf <function_name> [arguments...]\n";
exit(1);
}
$function_name = $argv[1];
$args = array_slice($argv, 2);
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DALL·E Image Generator</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 50px;
my coding timeline
2013 got very comfortable working with yaml as i configured minecraft servers
2014 got my first domain and made my first website
2015 started making minecraft mods and custom server software in java
2015 started making dynamic websites with Ruby on Rails
2018 started freelance frontend web development
2019 started wordpress (unfortunately, thus briefly)
2020 more advanced wordpress
2021 LARAVEL!
@caendesilva
caendesilva / high-level-oop-php-algorithms.md
Last active August 17, 2024 18:04
Example of a high-level algorithm in PHP using OOP to illustrate the concept described in a Tweet

Here's an example of a high-level algorithm in PHP using OOP to illustrate the concept described in this Tweet https://x.com/CodeWithCaen/status/1824869764696592676

class DocumentProcessor {
    private $document;
    private $analyzer;
    private $transformer;
    private $validator;
    private $publisher;
Keyboard Requirements
Full size, 100% keyboard with number pad, multimedia keys, and at least a few macros. Volume knob is a bonus.
Wired, don't need wireless. Backlit but couldn't care less about RGB. Mechanical is nice but not necessary.
At this point, I'm willing to spend several hundred dollars for a reliable quality keyboard that will last.
I'm a programmer, not a gamer, so I don't care about bells and whistles.
I just need something solid that I can comfortably type on for hours a day.
@caendesilva
caendesilva / .gitattributes
Created July 19, 2024 20:20
General .gitattributes file
* text=auto eol=lf
/tests export-ignore
/.github export-ignore
/.gitignore export-ignore
/.gitattributes export-ignore
/composer.lock export-ignore
/phpunit.xml export-ignore
// Best we've got
<h1>Frankenstein</h1>
<p role="doc-subtitle">Or: The Modern Prometheus</p>
// How about this? (Inspired by form label and input coupling)
<h1>
Frankenstein
<subhead>Or: The Modern Prometheus</subhead>
</h1>