Skip to content

Instantly share code, notes, and snippets.

View df2k2's full-sized avatar

Chris Snedaker df2k2

  • Stuart, Florida
View GitHub Profile
@df2k2
df2k2 / docker-help.md
Created October 19, 2020 23:28 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@df2k2
df2k2 / string_to_1_or_0_example.php
Last active August 27, 2020 13:31
PHP String converted to boolean
<?php
$stringToBool = (preg_match('/yes|true|(?<!-)[1-9]/i', $value)) ?: 0;
$value = ["yes","1","true","0","false","no",1,"NO","No","YES","Yes",false,true,"no",-1,0,6 ];
foreach ($value as $v) {

Code smells in CSS

How can you tell if your CSS code smells? What are the signs that the code is sub-optimal, or that the developer hasn't done a good job? What do you look for in the code to determine how good or bad it is?

  1. Styles that undo styles
  2. Magic Numbers - header.menu { margin: 12px 37px 9px 6px; }
  3. Complex Selectors - header.top-header .nav-bar nav.menu ul.main-nav > li a.link-item { font-weight: bold; }
  4. Increasing Specificity Needlessly - body.cms-home-page .footer-block .footer-title { font-size:35px; }
  5. "!important" - !important should only ever be used proactively, not reactively. - .footer-block .footer-title { font-size:33px !important; }
@df2k2
df2k2 / 20181129-scidomainsample.md
Last active November 29, 2018 19:19
cy int hollow geez domaination -- the short list

Domains Sample

Quick sampling of some of the domains that make me rofl.

This list makes me LOL at how much money is wasted on less-than-intelligent tech "investments." Clearly they are picking from the bottom of the barrel. It's clear to me why I never see anything related to this stuff on the internet. I think their tech workers are secretly sabotaging the internet presence. So funny.


click windows start icon, type: cmd, then right click on the "best match" command prompt, select "run as administrator"

when the command prompt window opens, paste the following line and hit enter.

reg add "HKLM\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 1 /f

Reboot your computer.

@df2k2
df2k2 / e1-1.md
Last active May 27, 2018 05:30
example1-1

Markdown Syntax

class Config
{
    private $data;

    public function init() // or load()
    {
        $this->data = $this->fileReader->load('cache.xml');
@df2k2
df2k2 / 20180313-phpversions.md
Last active April 6, 2018 08:24
PHP versions returned from scanning 5000 ecommerce-related websites.

Scanned 5000 'ecommerce' websites

29.82% (1491 of that 5000) returned a version of PHP in the header.

Interesting to see that PHP Version 5.4, which EOL was on Sep 3, 2015, is at the top of the list.

PHP 5.5.x EOL since Jul 21, 2016

Count Name Pct (count/1491)
@df2k2
df2k2 / df2k2-category_simple_not_visible_info.php
Last active December 6, 2016 03:22
Df2k2's Magento Scripts
<?php
/**
* External Script for listing categories levels and the quantity of various product types and
*
* @copyright Copyright (c) 2016 Chris Snedaker
* @author Chris Snedaker <df2002@gmail.com>
*
*/
// This file is placed in a sub-directory of Magento's root.
@df2k2
df2k2 / SassMeister-input.scss
Created February 22, 2016 03:27
Generated by SassMeister.com.
// ----
// Sass (v3.4.21)
// Compass (v1.0.3)
// Bootstrap Sass (v3.3.6)
// Bourbon (v4.2.6)
// Neat (v1.6.0)
// ----
@import "bourbon/bourbon";
@import "neat/neat";