Skip to content

Instantly share code, notes, and snippets.

View quangpro1610's full-sized avatar
🏠
Working from home

Hoang Quang quangpro1610

🏠
Working from home
View GitHub Profile
@quangpro1610
quangpro1610 / corona.php
Last active February 16, 2022 10:40
API get data sumary about corona virus of Vietnam and Global
<?php
header('Content-Type: text/html; charset=utf-8');
$url = 'https://code.junookyo.xyz/api/ncov-moh/data.json';
$content = file_get_contents($url);
$json = json_decode($content, true);
$data = $json['data'];
$result = array(
'messages' => array(
'0' => array(
@quangpro1610
quangpro1610 / weather-bot-vietnam.php
Created June 10, 2021 09:10
Xử lý lấy dữ liệu thời tiết trong ngày tại địa điểm
<?php
header('Content-Type: application/json; charset=utf-8');
$api_key = 'PUT_API_KEY_HERE';
if(!empty($_GET['province'])){
$province = $_GET['province'];
}else{
$province = 'Quang Tri';
}
$url = 'http://api.openweathermap.org/data/2.5/weather?q=' . $province . ',vietnam&appid=' . $api_key . '&units=metric&lang=vi';
$content = file_get_contents($url);
@quangpro1610
quangpro1610 / open-weather-map-api.php
Last active June 5, 2021 10:24
The API for Weather
<?php
header('Content-Type: application/json; charset=utf-8');
$api_key = 'PUT YOUR API HERE';
if(!empty($_GET['province'])){
$province = $_GET['province'];
}else{
$province = 'Quang Tri';
}
$url = 'http://api.openweathermap.org/data/2.5/forecast?q=' . $province . ',vietnam&appid=' . $api_key . '&units=metric&lang=vi';
$content = file_get_contents($url);
<?php
header('Content-Type: text/html; charset=utf-8');
$url = file_get_contents('https://api.tumblr.com/v2/blog/gaixinhchonloc.com/posts/photo?api_key=OAuth_Consumer_Key');
$json = json_decode($url, true);
$json_posts = $json['response']['posts'];
$data = array();
foreach ($json_posts as $key => $value) {
$data[] = $value['photos'][0]['original_size']['url'];
}
<div class="jcarousel">
<ul>
<li><img src="https://sorgalla.com/jcarousel/examples/_shared/img/img1.jpg" alt="img1"></li>
<li><img src="https://sorgalla.com/jcarousel/examples/_shared/img/img2.jpg" alt="img2"></li>
<li><img src="https://sorgalla.com/jcarousel/examples/_shared/img/img3.jpg" alt="img3"></li>
<li><img src="https://sorgalla.com/jcarousel/examples/_shared/img/img4.jpg" alt="img4"></li>
<li><img src="https://sorgalla.com/jcarousel/examples/_shared/img/img5.jpg" alt="img5"></li>
<li><img src="https://sorgalla.com/jcarousel/examples/_shared/img/img6.jpg" alt="img6"></li>
</ul>
</div>
<script type="text/javascript">
(function ($) {
$(function () {
$('.jcarousel').jcarousel();
$('.jcarousel-control-prev')
.on('jcarouselcontrol:active', function () {
$(this).removeClass('inactive');
})
.on('jcarouselcontrol:inactive', function () {
$(this).addClass('inactive');
<!--jCarousel basic stylesheet-->
<link rel="stylesheet" type="text/css" href="https://sorgalla.com/jcarousel/examples/basic/jcarousel.basic.css" />
<!--jQuery library-->
<script type="text/javascript" src="https://sorgalla.com/jcarousel/vendor/jquery/jquery.js"></script>
<!--jCarousel library-->
<script type="text/javascript" src="https://sorgalla.com/jcarousel/dist/jquery.jcarousel.min.js"></script>
<link href='https://rawgit.com/quangpro1610/quangpro1610.github.io/master/resources/SyntaxHighlighter/shCoreDefault.css' media='screen' rel='stylesheet' type='text/css'/>
<script src="https://rawgit.com/quangpro1610/quangpro1610.github.io/master/resources/SyntaxHighlighter/shCore.js" type="text/javascript"></script>
<script src="https://rawgit.com/quangpro1610/quangpro1610.github.io/master/resources/SyntaxHighlighter/shBrushCss.js" type="text/javascript"></script>
<script src="https://rawgit.com/quangpro1610/quangpro1610.github.io/master/resources/SyntaxHighlighter/shBrushXml.js" type="text/javascript"></script>
<script src="https://rawgit.com/quangpro1610/quangpro1610.github.io/master/resources/SyntaxHighlighter/shBrushJScript.js" type="text/javascript"></script>

Keybase proof

I hereby claim:

  • I am quangpro1610 on github.
  • I am quangpro1610 (https://keybase.io/quangpro1610) on keybase.
  • I have a public key ASBwBpFA9pbsTcbQ5z78XiAW6IZO32Ry7g7RkWvOPJaYZwo

To claim this, I am signing this object:

@quangpro1610
quangpro1610 / AND_OR_NOT
Created January 14, 2019 16:01 — forked from oliverdoetsch/AND_OR_NOT
Blogger: Globally conditional data tags for all page types
#AND
<b:if cond='data:blog.pageType == "index"'>
<b:if cond='data:blog.searchQuery'>
<!--search_page AND index_page-->
</b:if>
</b:if>
#OR