This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
## | |
# Make your Mac feel like home... | |
# Shoutout to @dtsn for being generally awesome and getting me started. | |
# | |
# install it: | |
# curl -sL https://gist.github.com/BenNunney/7219538/raw/f9b933cca93b67dd63a2d8b1eeebb69e87dc9591/feels-like-home.sh | sh | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// I have a function, embedVine(), which is a Wordpress shortcode. It uses one attribute, $id which I've assigned to $vine_id to avoid confusion ($post_id etc). This shortcode takes the ID (Vine IDs are the ending of the Vine URL, e.g http://vine.co/v/hx9LlrZxdqV, the id = hx9LlrZxdqV) and embed's the Vine within a Wordpress post. The shortcode markup is [vine id='...']. | |
$vine_id = false; | |
global $vine_id; | |
function embedVine($atts) { | |
global $vine_id; | |
extract(shortcode_atts(array( | |
"id" => '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('form.fileEdit input[type="submit"]').on('click', function(e) { | |
e.preventDefault(); | |
var _$thisElem = $(this); | |
$.getJSON(ADMIN_URL+'filemanager/editfile', | |
_$thisElem.parent('form').serialize(), | |
function(data) { | |
alert(data); | |
getFiles({clearout:true}); | |
} | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$query = ' | |
CREATE TABLE products ( | |
product_id int not null auto_increment PRIMARY KEY, | |
product_name varchar(100), | |
description varchar(200), | |
photo_url varchar(100), | |
price decimal(4,2), | |
stock_level decimal(3,0) | |
); | |
'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(!jQuery('<input PLACEHOLDER="1" />')[0].placeholder){ //Uppercase attr for IE | |
jQuery(':input[placeholder]').each(function(){ | |
var $this = $(this); | |
if(!$this.val()){ | |
$this.val($this.attr('placeholder')); | |
$this.addClass('input-placeholder'); | |
} | |
}).live('focus', function(e){ | |
var $this = $(this); | |
if($this.hasClass('input-placeholder')){ |