Skip to content

Instantly share code, notes, and snippets.

View bhowe's full-sized avatar

Blake Howe bhowe

View GitHub Profile
@bhowe
bhowe / gist:7e7acf9453706cd7c0a7
Last active August 29, 2015 14:13
Simple Case to check if an SSL port is active
<?php
/*
Blake B Howe
http://blakebhowe.com
*/
function checkConnection()
{
@bhowe
bhowe / gist:1a223b6877c34d00067c
Last active August 29, 2015 14:15
Connection to SQL Server from PHP on linux
<?php
/*
Blake B Howe
http://blakebhowe.com
*/
error_reporting(E_ALL);
# dbs are configured in file /etc/tds.datasource.template.
@bhowe
bhowe / gist:38ac7a9adec041ff8d8d
Last active September 8, 2019 14:40
Curl Command well formatted
/*
Blake B Howe
http://blakebhowe.com
*/
==========================================
CURL COMMAND
==========================================
@bhowe
bhowe / gist:a5e34d1c09453036fa86
Last active August 29, 2015 14:15
Pagespeed API
/*
Blake B Howe
http://blakebhowe.com
*/
$ch = curl_init("https://www.googleapis.com/pagespeedonline/v1/runPagespeed?url=http://wiseguystechnologies.com/&key=APIKEYHERE");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$res = curl_exec($ch);
<?php
/*
DONT FORGET TO DELETE THIS SCRIPT WHEN FINISHED!
*/
/*
Blake B Howe
http://blakebhowe.com
*/
@bhowe
bhowe / gist:892434add32e825fd72a
Created December 23, 2015 02:54
Show all the columns names in a table
$result = mysql_query("SHOW COLUMNS FROM TABLENAME");
if (!$result) {
echo 'Could not run query: ' . mysql_error();
exit;
}
if (mysql_num_rows($result) > 0) {
while ($row = mysql_fetch_assoc($result)) {
echo $row['Field']."<br>";
}
}
<!-- Sample Content to Plugin to Template -->
<h1>CSS Basic Elements</h1>
<div class="entry-content">
Below is just about everything you’ll need to style in the theme. Check the source code to see the many embedded elements within paragraphs.
<hr />
<h1>Heading 1</h1>
@bhowe
bhowe / robots.txt
Last active October 4, 2016 01:22
Robots.txt file for wordpress
# cavet always check your site with fetch as google bot in webmaster tools to make sure your not blocking anything needed as you add
# https://yoast.com/robots.txt
# https://yoa.st/robots-txt
User-Agent: *
RegEx's that you can use to match @media rules are:
^\@media\s(.*?)\{$
^ = assert position at start of the string
\@ = matches the character @ literally
media = matches the characters media literally
\s = match any white space character [\r\n\t\f ]
.*? = matches any character (except newline)
{ = matches the character { literally
#good responsive video code
/* Video Container
------------------------------------------------------------ */
.video-container {
position: relative;
padding-bottom: 56.25%;
/*padding-top: 30px;*/
height: 0;