Skip to content

Instantly share code, notes, and snippets.

@g33kidd
g33kidd / joshuak.me
Created March 23, 2014 07:31
LAMP Virtual Host example.
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName joshuakme.dev
DocumentRoot /var/www/joshuak
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/joshuak>
Options Indexes FollowSymLinks MultiViews
@g33kidd
g33kidd / SassMeister-input-HTML.html
Created October 23, 2014 21:18
Generated by SassMeister.com.
<div class="terminal-window">
<div class="navbar">
<div class="action close"><div class="circle"></div></div>
<div class="action min"><div class="circle"></div></div>
<div class="action full"><div class="circle"></div></div>
</div>
<div class="terminal">
<p class="login">Last login: Thu Oct 23 11:31:12 on ttys000</p>
<p class="user">
<span class="username">joshkidd</span> <span>at</span> <span class="sys">Mac-mini</span> <span>in</span> <span class="dir">~</span>
@g33kidd
g33kidd / customizer.php
Created October 28, 2014 22:04
Customizer Function
<?php
function extend_customizer() {
global $wp_customize;
// Add Panel
$wp_customize->add_panel('example', array(
'title' => 'Example Panel',
'description' => 'Description',
'priority' => 80
@g33kidd
g33kidd / SassMeister-input-HTML.html
Created March 30, 2015 16:29
Generated by SassMeister.com.
<div class="dropdown">
<input type="checkbox" id="dropdownToggle" />
<label for="dropdownToggle">DROPDOWN</label>
<ul class="dropdown-menu">
<li>List Item</li>
<li>List Item</li>
</ul>
</div>
if(Meteor.isServer()) {
Meteor.methods({
postTweet: function() {
Twitter = new TwitMaker({
consumer_key: Meteor.settings.twitterKey,
consumer_secret: Meteor.settings.twitterSecret,
access_token: Meteor.user().services.twitter.accessToken,
access_token_secret: Meteor.user().services.twitter.accessTokenSecret
@g33kidd
g33kidd / repo_storage.ex
Last active December 1, 2015 19:55
custom storage module for OAuth2Ex in Elixir
defmodule StorageUpload.RepoStorage do
@moduledoc """
This is a storage module built based on OAuth2Ex's file storage.
The only difference here is that the token is fetched from the Repo
in the app and stored in the Repo's data store.
"""
alias StorageUpload.Repo
alias StorageUpload.Setting
/*
* twitter-entities.js
* This function converts a tweet with "entity" metadata
* from plain text to linkified HTML.
*
* See the documentation here: http://dev.twitter.com/pages/tweet_entities
* Basically, add ?include_entities=true to your timeline call
*
* Copyright 2010, Wade Simmons
* Licensed under the MIT license
<?php
/**
Validate an email address.
Provide email address (raw input)
Returns true if the email address has the email
address format and the domain exists.
*/
function check_email_valid($email){
$isValid = true;
<?php function sanitize_page($buffer) {
$search = array('/\>[^\S ]+/s', '/[^\S ]+\</s', '/(\s)+/s');
$replace = array('>', '<', '\\1');
$buffer = preg_replace($search, $replace, $buffer);
function gzip_doc($buffer) { if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) { return ob_gzhandler($buffer, 5); } else { return $buffer; }}
return gzip_doc($buffer);
} ?>
@g33kidd
g33kidd / standards.scss
Created October 12, 2013 10:34
Prefered Coding Standard: SASS + Bourbon Neat
.class-name {
// styles for the parent class first.
font-size:20px;
margin-left:15px;
padding:20px 5px;
font-family: 'Lato', sans-serif;
background-color:#333;
// styles for html elements before any child classes.
ul {