Skip to content

Instantly share code, notes, and snippets.

View unwiredtech's full-sized avatar

Patrick Sarmiento unwiredtech

View GitHub Profile
@bradtraversy
bradtraversy / pdo_db.php
Created February 21, 2018 12:56
PDO Class
<?php
/*
* PDO DATABASE CLASS
* Connects Database Using PDO
* Creates Prepeared Statements
* Binds params to values
* Returns rows and results
*/
class Database {
private $host = DB_HOST;
@sgnl
sgnl / README.md
Last active November 9, 2022 21:48
Setting up SASS (SCSS) files with gulp, gulp-sass, and Browser Sync!

Create a new temp project

  1. $ mkdir sass_gulp_workshop
  2. cd into the new directory
  3. Initialize NPM: $ npm init --yes
  4. Install gulp and gulp-sass packages: $ npm install -D gulp gulp-sass browser-sync
  5. Update package.json's scripts section with this key-value pair: "scripts": { "dev": "gulp" }
  6. Recreate this file structure in this directory:
  • public (directory)
    • css (directory)
    • index.html (file)
@salcode
salcode / bsg-customizer-navbar-logo.php
Created August 6, 2015 20:46
Bootstrap Genesis - add the logo in the nav to the customizer. This file can be dropped into the wp-content/mu-plugins/ directory (note: you may need to create the mu-plugins folder within wp-content if it does not already exist)
<?php
// add customizer controls
add_action( 'customize_register', 'bsg_navbar_brand_logo_customize_register' );
function bsg_navbar_brand_logo_customize_register( $wp_customize ) {
$wp_customize->add_setting( 'brand_logo',
array(
'default' => '',
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
@neilgee
neilgee / preheaderwidgetararea.php
Last active August 29, 2015 13:57
Genesis Pre-Header Widget Area Full Width Wrap Left and Right
<?php
//Add in new Widget areas
function genesischild_extra_widgets() {
genesis_register_sidebar( array(
'id' => 'preheaderleft',
'name' => __( 'preHeaderLeft', 'genesischild' ),
'description' => __( 'This is the preheader Left area', 'genesischild' ),
'before_widget' => '<div class="first one-half preheaderleft">',
'after_widget' => '</div>',