Skip to content

Instantly share code, notes, and snippets.

View bepatrickdavid's full-sized avatar

bepatrickdavid bepatrickdavid

View GitHub Profile
@bepatrickdavid
bepatrickdavid / gist:a0e2ab36c67e22a8ee13
Last active August 29, 2015 14:21
GMAPS: Mappa con pin e colori
<div class="row maps">
<div class="col-md-12" id="map-canvas">
</div>
</div>
<!-- Google Maps -->
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true"></script>
<script>
@bepatrickdavid
bepatrickdavid / gist:ad7681324ae21ddc373c
Created June 9, 2015 14:46
jQUERY: Get videos of channel youtube api v3
<div id="youtube-mychannel">
<ul id="results"></ul>
</div>
<style>
#youtube-mychannel ul {
width:100%;
}
#youtube-mychannel ul li{
@bepatrickdavid
bepatrickdavid / gist:c2c1ed09feca001d710d
Last active July 20, 2017 16:40
WP: Woocommerce add new custom field checkout
//example
function add_custom_stock_type() {
?>
<script type="text/javascript">
jQuery(function(){
jQuery('._stock_status_field').not('.custom-stock-status').remove();
});
</script>
<?php
@bepatrickdavid
bepatrickdavid / gist:f2b4e373c31e2147f452
Last active August 29, 2015 14:23
WP: shortcode video HTML5
function video_dp_shortcode( $atts ) {
extract( shortcode_atts(
array(
'poster' => NULL,
'mp4' => NULL,
'ogg' => NULL,
'webm' => NULL,
), $atts )
);
@bepatrickdavid
bepatrickdavid / footer.php
Last active September 29, 2015 09:44
WP: Template Tips codici tema intestazioni utili
@bepatrickdavid
bepatrickdavid / gist:0dda7e65c8d3edee3154
Created June 30, 2015 08:11
WP: Query with multiple post type limit to three item and order by date - Query diversi post type
<?php $any = get_posts( 'post_type[]=post&post_type[]=portfolio' ); ?>
<?php foreach(array_slice($any, 0, 3) as $a): ?>
<?php endforeach ?>
@bepatrickdavid
bepatrickdavid / gist:1c0416437aab53b04446
Last active April 23, 2018 09:40
CSS: IE FIrefox Safari Hack
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
/* IE10+ specific styles go here */
.example {
overflow: visible !important;
}
}
@supports (-ms-accelerator:true) {
/* Edge */
}
@supports (-ms-ime-align:auto) {
@bepatrickdavid
bepatrickdavid / gist:5b3612713c4ffa0613c3
Created July 8, 2015 07:10
CSS: allineamento liste indentazione seconda terza riga
/* example */
ul li{
list-style:none;
text-indent: -1.5em;
padding-left: 3em;
}
@bepatrickdavid
bepatrickdavid / functions.php
Last active August 29, 2015 14:24
PHP: Read RSS Feed with limit
function getFeed($feed_url, $limit) {
$content = file_get_contents($feed_url);
$x = new SimpleXmlElement($content);
echo "<ul>";
$count = $limit;
foreach($x->channel->item as $entry) {
@bepatrickdavid
bepatrickdavid / gist:5ad0f99097b71bcc9814
Created July 10, 2015 11:02
CSS: gradient over background image
.bg:before {
content: '';
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: rgba(0,0,0,0.3);
}