Skip to content

Instantly share code, notes, and snippets.

View tcelestino's full-sized avatar
🙃

Tiago Celestino tcelestino

🙃
View GitHub Profile
@tcelestino
tcelestino / custom-css.css
Last active December 16, 2015 00:29
custom stylesheets example
/* image replacement
Scott Kellum
*/
.ir {
text-indent: 100%;
white-space: nowrap;
overflow: hidden;
}
@tcelestino
tcelestino / add-post-with-upload-images-front.php
Last active December 15, 2015 23:49
Criação de um post no WordPress no front-end com upload de imagem.
<?php
// adiciona o post ao WordPress
add_action('wp_ajax_nopriv_post_insert', 'post_insert');
add_action('wp_ajax_post_insert', 'post_insert');
function post_insert(){
require_once(ABSPATH . 'wp-admin/includes/image.php');
if('POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] )) {
@tcelestino
tcelestino / README.md
Last active October 8, 2020 22:48
Gallery YouTube videos using PHP and jQuery

Gallery YouTube Videos

Example with usage api YouTube with jQuery and PHP.

@tcelestino
tcelestino / shorten.php
Created March 8, 2013 19:34
shorten url using bit.ly api
<?php
//função do curl baseado no script do David Walsh (http://davidwalsh.name/)
function curl_get_result($url) {
$ch = curl_init($url);
$timeout = 50;
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
$data = curl_exec($ch);
@tcelestino
tcelestino / README.md
Last active October 8, 2020 22:49
Gallery photos with jQuery (no plugin)

Gallery Photo with jQuery

Example gallery photos using jQuery (without plugin).

*This a experiment for learn jQuery basic

@tcelestino
tcelestino / README.md
Last active December 14, 2015 16:59
show metabox in wordpress save data

Criando um metabox no WordPress

Um exemplo de como criar um metabox para upload no WordPress

@tcelestino
tcelestino / gist:5052527
Created February 27, 2013 22:41
Animate scrollTop using jQuery.
function scrollUp() {
var content_animate = $(jQuery.browser.webkit ? "body": "html"); // bug fix to animate on firefox and uses to opera and ie.
var _position = content_animate.scrollTop();
if(_position > 0) {
content_animate.animate({
scrollTop: 0
}, 1500);
}
}
@tcelestino
tcelestino / gist:4959890
Last active December 13, 2015 19:08
Remove item for array - by Andrey Knupp (https://github.com/andreyknupp)
Array.prototype.remove = function(i) {
var index;
if( ( index = this.indexOf( i ) ) !== -1 ) {
this.splice( index , 1 );
}
return this
};
@tcelestino
tcelestino / google_maps.css
Last active December 11, 2015 20:48
How to fix bug Google Maps controls and infowindow.
#maps {
width: 100%;
height: 100%;
}
// this is solution
#maps img {
max-width: inherit;
}