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 routes = (function(history){ | |
| var pushState = history.pushState; | |
| history.pushState = function(state) { | |
| typeof(history.onpushstate) == "function" && history.onpushstate({state: state}); | |
| setTimeout(routes.check, 10); | |
| return pushState.apply(history, arguments); | |
| }; | |
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
| # Adiciona um usuário para fazer acesso remoto | |
| adduser usuariogit | |
| # Adiciona o grupo "minhaequipe" para trabalho em equipe | |
| addgroup minhaequipe | |
| # Adiciona o usuário "usuariogit" ao grupo minhaequipe | |
| usermod -a -G minhaequipe usuariogit | |
| # Lembre-se de adicionar também seu usuário ao grupo minhaequipe |
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
| <style> | |
| .absmiddle { | |
| display:flex; | |
| align-items:center; | |
| } | |
| </style> | |
| <div class="absmiddle" style="height:100px; background:gold"> | |
| <div> | |
| Elemento verticalmente centralizado! | |
| </div> |
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 | |
| add_filter('get_comment_number', 'comment_count', 0); | |
| function comment_count( $count ) { | |
| if ( ! is_admin() ) { | |
| global $id; | |
| $comments_by_type = &separate_comments(get_comments('status=approve&post_id=' . $id)); | |
| return count($comments_by_type['comment']); | |
| } else { | |
| return $count; |
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
| # Adiciona um usuário para fazer acesso remoto | |
| adduser gituser | |
| # Adiciona um grupo chamado git | |
| addgroup git | |
| # Adiciona o usuário "gituser" ao grupo git | |
| usermod -a -G git gituser | |
| # Acesse pasta desejada e crie um novo repositório |
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 register_shortcode_script() { | |
| add_shortcode('script', function($src) { | |
| extract(shortcode_atts(array( | |
| 'src' => 'src' | |
| ), $src)); |
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
| // URL com a Query do YQL | |
| var url = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.xchange%20where%20pair%3D%22USDBRL%22&format=json&diagnostics=false&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys"; | |
| // Obtem e trata os dados em JSON | |
| $.getJSON( url, function( data ) { | |
| // Agrupa os dados em HTML | |
| try { | |
| var indices = '<p><strong>DOLAR</strong> R$ '+data.query.results.rate[0].Rate+'</p>'; | |
| } catch(err) { |
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
| sudo echo "Acquire::ForceIPv4 \"true\";" > /etc/apt/apt.conf.d/99force-ipv4 |
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
| git update-index --assume-unchanged .htaccess |
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 get_youtube_channel_ID($url){ | |
| $html = file_get_contents($url); | |
| preg_match("'<meta itemprop=\"channelId\" content=\"(.*?)\"'si", $html, $match); | |
| if($match && $match[1]); | |
| return $match[1]; | |
| } |