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
| #filtrando e removendo embeds para instant article | |
| def ia_clean_html(text) | |
| text.scan(/\[embed\s(?:\s*\w+\s*=\s*['"][^"]*['"]\s*)+\]/).each do |embed| | |
| case embed | |
| when /namespace=['"]images['"]/ | |
| img_url = embed.match('url=[\"](.*)[\"]\s')[1] | |
| img_caption = embed.match('description=\"([^"]*)\"')[1] |
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
| <!doctype html> | |
| <html lang="en" prefix="op: http://media.facebook.com/op#"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <!-- URL of the web version of this article --> | |
| <!-- TODO: Change the domain to match the domain of your website --> | |
| <link rel="canonical" href="<%=page_url%>"> | |
| <meta property="op:markup_version" content="v1.0"> | |
| </head> | |
| <body> |
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 | |
| }); |
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
| 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
| 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
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
| <?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
| <?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 | |
| //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'> |