This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function thumbYoutube($link){ | |
| $id = substr($link,31,11); | |
| $url = 'http://i' . rand(1, 4) .'.ytimg.com/vi/'. $id .'/hqdefault.jpg'; | |
| return $url; | |
| }?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function add_head($function_to_add, $priority = 10, $accepted_args = 1) { | |
| add_action("wp_head", $function_to_add, $priority, $accepted_args); | |
| } ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //http://phpflickr.com/ | |
| require_once("incs/phpflickr.php"); | |
| $f = new phpFlickr("afedae4d8b7b983cebea0af35b0f3f21"); | |
| $usuario = '67844506@N07'; | |
| $recent = $f->people_getPublicPhotos($usuario,NULL,NULL,12,1); | |
| foreach ($recent['photos']['photo'] as $foto) { | |
| echo "<li><a rel='example_group' href='http://farm".$foto['farm'].".static.flickr.com/".$foto['server']."/".$foto['id']."_".$foto['secret']."_z.jpg'> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php function catch_that_image() { | |
| global $post, $posts; | |
| $first_img = ''; | |
| ob_start(); | |
| ob_end_clean(); | |
| $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches); | |
| $first_img = $matches [1] [0]; | |
| if(empty($first_img)){ //Defines a default image | |
| $first_img = ""; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //$post->ID = Post atual | |
| $tags = wp_get_post_tags($post->ID); | |
| if($tags) : | |
| $tag_ids = array(); | |
| foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id; | |
| $args=array( | |
| 'tag__in' => $tag_ids, | |
| 'post__not_in' => array($post->ID), | |
| 'showposts'=>6, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
| { | |
| "bold_folder_labels": false, | |
| "caret_extra_width": 2, | |
| "color_scheme": "Packages/Theme - Spacegray/base16-ocean.dark.tmTheme", | |
| "detect_slow_plugins": false, | |
| "draw_white_space": "all", | |
| "enable_tab_scrolling": false, | |
| "fade_fold_buttons": false, | |
| "file_selected_text": true, | |
| "flatland_sidebar_tree_xsmall": false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var yt = (function() { | |
| return { | |
| init: function() { | |
| this.feed('US'); | |
| this.filter(); | |
| this.countryName('US'); | |
| }, | |
| feed: function(country){ | |
| $.getJSON('http://gdata.youtube.com/feeds/api/standardfeeds/'+country+'/most_popular?time=all_time&v=2&alt=json', function(data) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = function(grunt) { | |
| // Project configuration. | |
| grunt.initConfig({ | |
| pkg: grunt.file.readJSON('package.json'), | |
| jshint: { | |
| files: ['Gruntfile.js', '_/js/*.js'], | |
| options: { | |
| globals: { | |
| jQuery: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function doStuff() { | |
| $.ajax({ | |
| url: "http://localhost/auth.js", | |
| dataType : "json", | |
| error: function(xhr, status, errorThrown){ | |
| }, | |
| success: function(data){ | |
| console.log(data.auth); | |
| if(!data.auth){ | |
| window.location = "http://www.google.com/"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| google.maps.event.addListenerOnce(map, 'idle', function(){ | |
| // do something only the first time the map is loaded | |
| }); |
OlderNewer