Skip to content

Instantly share code, notes, and snippets.

View nhobi's full-sized avatar
🌼

Nate nhobi

🌼
View GitHub Profile
@nhobi
nhobi / dd.sublime-snippet
Last active October 4, 2017 17:46
A quick, one-line PHP debugging snippet for Sublime Text. Think Laravel's dd() helper function for non-Laravel things.
<snippet>
<content><![CDATA[
echo '<pre>'; var_dump(\$${1:variable_name_here}); echo '</pre>'; exit();
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>dd</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>
@nhobi
nhobi / Logger.cs
Last active April 13, 2016 15:16
Dead simple C# logging without config file dependency.
using System;
using System.IO;
public class Logger
{
private string LogFilePath { get; set; }
private string FileExtension { get; set; }
private string FilePrefix { get; set; }
public Logger(string path, string filePrefix = "Log", string fileExtension = ".txt")
@nhobi
nhobi / functions.php
Last active April 8, 2016 17:43
Responsive WordPress oEmbeds
<?php
function responsive_oembed_filter($markup, $url, $attr, $post_ID) {
return '<div class="video-container">' . $markup . '</div>';
}
add_filter( 'embed_oembed_html', 'responsive_oembed_filter');