Skip to content

Instantly share code, notes, and snippets.

View rcstr's full-sized avatar
:shipit:
Engineering

Rommel Castro rcstr

:shipit:
Engineering
View GitHub Profile
@rcstr
rcstr / category-template.28492.php
Created June 9, 2015 04:50
category-template.php
if ( isset( $args['value_field'] ) && isset( $category->{$args['value_field']} ) ) {
$value_field = $args['value_field'];
$value = esc_attr( $category->{$value_field} );
} elseif( isset( $args['value_field'] ) && 'url' === $args['value_field'] ) {
$value = esc_url( get_term_link( $category ) );
} else {
$value_field = 'term_id';
$value = esc_attr( $category->{$value_field} )
}
@rcstr
rcstr / let.js
Created May 2, 2015 02:31
a couple of things i learned about JS today
(function() {
"use strict";
{ // YAY! we can use braces just like this
let foo = 'bar';
}
console.log(foo); // undefined, the magic of let
})();
@rcstr
rcstr / sum
Created December 15, 2014 23:43
Function sum() {
var result;
for(var i = 0; i < arguments.length; i++) {
result = result + argumnts[i];
}
return result;
}
var $btn = $('#btn');
(isEnable) ? $btn.fadeIn() : $btn.hide();
.opaque {
color: red;
background-color:rgba(255,0,0,0.5);
}
@font-face {
font-family: 'Lato';
font-style: normal;
font-weight: 100;
src: local('Lato Hairline'), local('Lato-Hairline'), url(http://fonts.gstatic.com/s/lato/v11/h3_FseZLI76g1To6meQ4zX-_kf6ByYO6CLYdB4HQE-Y.woff2) format('woff2');
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
var hasFlash = false;
try {
hasFlash = Boolean(new ActiveXObject('ShockwaveFlash.ShockwaveFlash'));
} catch (exception) {
hasFlash = ('undefined' != typeof navigator.mimeTypes['application/x-shockwave-flash']);
}
function paymentCheck() {
var obj = {
'type': 'car',
'year': 2008,
'make': 'Dodge',
'model': 'Avenger',
'payments': 'in process',
'paid': 13286,
'toBePaid': 34856,
'paymentsLeft': 24,
function supports_video() {
return !!document.createElement('video').canPlayType;
}
Console.prototype.log = function() {};
Console.prototype.error = function() {};
window.console = new console;