Alexkwatson Alexkwatson

View livetext
1 2 3 4 5
$(document).ready(function(){
$('#mytext').keyup(function(){
$('#carrytext').html(this.value);
});
});
View gist:5076630
1 2 3 4 5 6 7 8 9 10
/* ------------ RESPONSIVE MEDIA QUERIES ------- */
 
@media (max-width: 1024px) {
 
}
 
/* iPad portrait */
@media (max-width: 768px) {
 
}
View gist:5065357
1 2 3 4 5 6 7 8 9 10
function shortenText($text, $chars) {
 
// Change to the number of characters you want to display
$text = $text." ";
$text = substr($text,0,$chars);
$text = substr($text,0,strrpos($text,' '));
$text = $text."...";
 
return $text;
}
View gist:2029130
1 2 3 4 5 6 7 8 9 10
switch($_SERVER['SERVER_NAME']) {
//local
case 'localhost':
define('DB_NAME', '');
define('DB_USER', '');
define('DB_PASSWORD', '');
define('DB_HOST', '127.0.0.1');
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');
define('WP_DEBUG', true);
View snippet.php
1 2 3 4 5 6 7 8
// just add this to functions.php
 
function remove_page_class($wp_list_pages) {
$pattern = '/\<li class="page_item[^>]*>/';
$replace_with = '<li>';
return preg_replace($pattern, $replace_with, $wp_list_pages);
}
add_filter('wp_list_pages', 'remove_page_class');
View inception-javascript.js
1 2 3 4 5 6 7 8 9 10
/*
* Fabrizio Calderan, twitter @fcalderan, 2010.11.02
* I had an idea: could Inception movie be explained by a few javascript closures
* and variable resolution scope (just for fun)?
*
* Activate javascript console =)
*/
 
<script>
console.group("inception movie");
View gist:1989121
1 2 3 4 5 6 7 8 9 10
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
View gist:1989091
1 2 3 4 5 6 7 8 9 10
/* =Reset default browser CSS. Based on work by Eric Meyer: http://meyerweb.com/eric/tools/css/reset/index.html
-------------------------------------------------------------- */
 
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
Something went wrong with that request. Please try again.