Skip to content

Instantly share code, notes, and snippets.

@BoDonkey
BoDonkey / Log-.md
Created December 26, 2015 11:23 — forked from bgrins/Log-.md
Prevent errors on console methods when no console present and expose a global 'log' function.

Javascript log Function

Every time I start a new project, I want to pull in a log function that allows the same functionality as the console.log, including the full functionality of the Console API.

There are a lot of ways to do this, but many are lacking. A common problem with wrapper functions is that the line number that shows up next to the log is the line number of the log function itself, not where log was invoked. There are also times where the arguments get logged in a way that isn't quite the same as the native function.

This is an attempt to once and for all document the function that I pull in to new projects. There are two different options:

  • The full version: Inspired by the plugin in HTML5 Boilerplate. Use this if you are writing an application and want to create a window.log function. Additionally,
@BoDonkey
BoDonkey / add_apache_brew.md
Created April 23, 2017 10:43 — forked from vitorbritto/add_apache_brew.md
Install Apache with Homebrew

Install Apache with Homebrew

Installing Apache

# Start by stopping the built-in Apache, if it's running, and prevent it from starting on boot.
# This is one of very few times you'll need to use sudo:
sudo launchctl unload /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null

# We need to tap homebrew-dupes because "homebrew-apache/httpd22" relies on "homebrew-dupes/zlib"

and install Apache 2.2 with the event MPM, and we'll use Homebrew's OpenSSL library

@BoDonkey
BoDonkey / wp-config.php
Created May 14, 2017 12:01 — forked from indikatordesign/wp-config.php
Allows you to write the error.log right into the wp-content-folder. You can also use something like this to var_dump to your error log: - idWriteLog( $myVar, 'varName' ); - or - idWriteLog( myFunc(), 'funcName' ); - It is especially useful to var_dump ajax requests and will also show you on which filter your current dump is hooked.
<?php
// Add the snippet below in the file wp-config.php right above: /* That's all, stop editing! Happy blogging. */
define('WP_DEBUG', true );
if ( WP_DEBUG )
{
define('SAVEQUERIES', true );
@BoDonkey
BoDonkey / index.html
Created June 4, 2017 09:37
foundation sticky nav example for assistance
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Foundation | Welcome</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.3.1/css/foundation.min.css" />
<link rel="stylesheet" href="/main.css" />
</head>
<body>
@BoDonkey
BoDonkey / Contract Killer 3.md
Created June 11, 2017 15:08 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@BoDonkey
BoDonkey / demo.css
Created July 9, 2017 12:35 — forked from CodeMyUI/demo.css
SVG CSS3 Menu / Burger Button
*, *:before, *:after {
box-sizing: border-box;
}
body {
background: #158fef;
padding: 40px;
}
h4 {
@BoDonkey
BoDonkey / SCSS.md
Created July 17, 2017 10:23 — forked from jareware/SCSS.md
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso

@BoDonkey
BoDonkey / module.php
Created May 8, 2018 20:38
Responsive field code
//field
'horizontal_line_width' => array(
'label' => esc_html__('Horizontal Line Width', 'diti-divi-timeline'),
'type' => 'range',
'option_category' => 'layout',
'description' => esc_html__('Here you can set a width for the Horizontal Line.', 'diti-divi-timeline'),
'toggle_slug' => 'main_settings',
'mobile_options' => true,
'responsive' => true,
<?php
class ADNA_HelloWorld extends ET_Builder_Module {
public $slug = 'adna_hello_world';
public $vb_support = 'on';
protected $module_credits = array(
'module_uri' => '',
'author' => '',
@BoDonkey
BoDonkey / check.jsx
Created September 29, 2018 13:42
jsx for detecting change in checkbox
/ External Dependencies
import React, { Component } from 'react';
// Internal Dependencies
import './style.css';
class HelloWorld extends Component {
static slug = 'adna_hello_world';