Skip to content

Instantly share code, notes, and snippets.

View OksanaRomaniv's full-sized avatar

Oksana Romaniv OksanaRomaniv

  • Kalush, Ukraine
View GitHub Profile
@yaronguez
yaronguez / ACF Country List
Created February 17, 2015 01:37
Country list formatted for Advanced Custom Fields select dropdown
afghanistan : Afghanistan
albania : Albania
algeria : Algeria
american_samoa : American Samoa
andorra : Andorra
angola : Angola
anguilla : Anguilla
antigua_and_barbuda : Antigua and Barbuda
argentina : Argentina
armenia : Armenia
@vstm
vstm / gist:12cb0b79462e254b7d5c
Last active January 23, 2024 22:06
Debug wp_oembed-problems
<?php
require_once("wp-load.php");
add_action('http_api_debug', 'test_http_api_debug', 10, 5);
add_filter('oembed_remote_get_args', 'test_oembed_remote_get_args', 10, 2);
add_filter('oembed_fetch_url', 'test_oembed_fetch_url', 10, 3);
$embed_code = wp_oembed_get('http://vimeo.com/75343493');
@GaryJones
GaryJones / functions.php
Last active December 23, 2021 23:10
Wrap the last Genesis breadcrumb in a span for styling.
<?php
add_filter( 'genesis_build_crumbs', 'gj_wrap_last_breadcrumb', 10, 2 );
/**
* Wrap the last Genesis breadcrumb in a span for styling.
*
* @author Gary Jones
*
* @param array $crumbs Existing HTML markup for the breadcrumbs.
*
@bettysteger
bettysteger / es6-classes-inheritance.js
Last active October 11, 2020 00:05
ES6 Classes and Inheritance example (www.es6fiddle.net)
/**
* Classes and Inheritance
* Code Example from http://www.es6fiddle.net/
*/
class Polygon {
constructor(height, width) { //class constructor
this.name = 'Polygon';
this.height = height;
this.width = width;
}
// Random terminal tip #1
//You'll see this message if you git commit without a message (-m)
// You can get out of it with two steps:
// 1.a. Type a multi-line message to move foward with the commit.
// 1.b. Leave blank to abort the commit.
// 2. Hit "esc" then type ":wq" and hit enter to save your choice. Viola!
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
@oriolrivera
oriolrivera / today.js
Created October 15, 2014 20:43
jQuery Get Todays Date dd/mm/yyyy
var fullDate = new Date()
console.log(fullDate);
//Thu Otc 15 2014 17:25:38 GMT+1000 {}
//convert month to 2 digits
var twoDigitMonth = ((fullDate.getMonth().length+1) === 1)? (fullDate.getMonth()+1) :(fullDate.getMonth()+1);
var currentDate = fullDate.getDate() + "/" + twoDigitMonth + "/" + fullDate.getFullYear();
console.log(currentDate);
//15/10/2014
@josephabrahams
josephabrahams / socialSharePopups.js
Last active November 29, 2021 19:39
Facebook & Twitter Share Popup Windows
(function($) {
$('.js-share-twitter-link').click(function(e) {
e.preventDefault();
var href = $(this).attr('href');
window.open(href, "Twitter", "height=285,width=550,resizable=1");
});
$('.js-share-facebook-link').click(function(e) {
e.preventDefault();
var href = $(this).attr('href');
window.open(href, "Facebook", "height=269,width=550,resizable=1");
@m1r0
m1r0 / wp_insert_attachment_from_url.php
Last active April 11, 2024 12:33
WP: Insert attachment from URL
<?php
/**
* Insert an attachment from a URL address.
*
* @param string $url The URL address.
* @param int|null $parent_post_id The parent post ID (Optional).
* @return int|false The attachment ID on success. False on failure.
*/
function wp_insert_attachment_from_url( $url, $parent_post_id = null ) {
@ohryan
ohryan / responsive-align.less
Last active April 30, 2019 17:27
Bootstrap 3 Responsive Text Align
.text-xs-left { text-align: left; }
.text-xs-right { text-align: right; }
.text-xs-center { text-align: center; }
.text-xs-justify { text-align: justify; }
@media (min-width: @screen-sm-min) {
.text-sm-left { text-align: left; }
.text-sm-right { text-align: right; }
.text-sm-center { text-align: center; }
.text-sm-justify { text-align: justify; }
@miguelmota
miguelmota / copy.js
Last active March 20, 2020 10:10
Deep clone copy array with lodash (underscore)
var array = [{},{},{}];
var copy = _.map(array, _.clone);