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 | |
function parse_youtube_url($url){ | |
$id = ''; | |
preg_match("/^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|\\&v=)([^#\\&\\?]*).*/uism", $url, $matches); | |
if( isset($matches[2]) ){ | |
$id = $matches[2]; | |
} | |
return $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
// Usage: | |
// $("#element").yourPluginName("20px"); | |
// | |
// Reference functions | |
// $(‘#element’).data(‘pluginName’).functionName(); | |
(function($){ | |
$.yourPluginName = function(el, options){ | |
// To avoid scope issues, use 'base' instead of 'this' to reference this class from internal events and functions. | |
var base = this; |
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
tell application "iTunes" | |
if player state is playing then | |
set trackName to (get name of current track) | |
set trackArtist to (get artist of current track) | |
else | |
return | |
end if | |
end tell | |
("Listening to " & quote & trackName & quote & " by " & trackArtist & " ♫") as text |
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 | |
$query = db_select('node', 'n'); | |
$query->join('field_data_field_vertical', 'v', 'v.entity_id=n.nid'); | |
$query->join('field_data_field_date', 'd', 'd.entity_id=n.nid'); | |
$query | |
->fields('n', array('nid', 'title', 'created')) | |
->fields('d', array('field_date_value')) | |
->condition('v.field_vertical_tid', 1) | |
->condition('n.status', 1) | |
->condition('n.type', 'event') |
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
// placeholder text fallback | |
if(!Modernizr.input.placeholder){ | |
$('input').not('.placeholder-fallback-inited').each(function() { | |
var $this = $(this); | |
$this.val( $this.attr('placeholder') ); | |
$this.addClass('placeholder-fallback-inited'); | |
}) | |
.focus(function(){ | |
var $this = $(this); | |
if( $this.val() == $this.attr('placeholder') ){ |
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
// Smooth scrolling | |
$('a[href*=#]:not([href=#])').click(function() { | |
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') || location.hostname == this.hostname) { | |
var target = $(this.hash); | |
target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); | |
if (target.length) { | |
var scrollValue = target.offset().top; | |
$('html,body').animate({ | |
scrollTop: scrollValue | |
}, 1000); |
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
@app = angular.module('MyApp',[]); | |
@app.config ($httpProvider) -> | |
authToken = $("meta[name=\"csrf-token\"]").attr("content") | |
$httpProvider.defaults.headers.common["X-CSRF-TOKEN"] = authToken | |
$httpProvider.defaults.headers.common['Accept'] = "application/json" |
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
function addBigInts(a, b) { | |
var result = ''; | |
var carry = 0; | |
// convert to arrays and flip around | |
a = a.split('').reverse(); | |
b = b.split('').reverse(); | |
// we have to loop through the longer number to add all the values | |
var longerNumber = (a.length > b.length) ? a : b; |
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
body { | |
font-family: BodyRegular, "Verdana", "Tahoma" ; | |
font-weight: normal; | |
color: red; | |
background-color: #d1f8fd; | |
// Small Font Size Scaling | |
font-size: 12pt; | |
text-rendering: optimizeLegibility; | |
@for $i from 1 through 15 { |
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 | |
/** | |
* Local configuration information. | |
*/ | |
if (file_exists(dirname(__FILE__) . '/wp-config-local.php')): | |
require_once(dirname(__FILE__) . '/wp-config-local.php'); | |
/** | |
* Remote configuration settings. | |
*/ |
OlderNewer