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 / 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');

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 / 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.


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 / 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) {
@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