Skip to content

Instantly share code, notes, and snippets.

/*
* 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 {
@g33kidd
g33kidd / 0_reuse_code.js
Created November 7, 2013 22:58
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@g33kidd
g33kidd / new_gist_file.css
Created November 10, 2013 03:27
SOME CHANGES IN MY CSS
.dropdown {
background-imager: linear-gradient(50deg, #757575 0, #6f6f6f 20%, transparent 69%);
background-color:#999;
}
@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
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