This file contains 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
import requests | |
from flask import Flask, render_template | |
app = Flask(__name__) | |
API_KEY = "" | |
ENDPOINT = "https://newsapi.org/v2/top-headlines" | |
@app.route("/") |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
# :~ faryne$ cat sample.yaml | yq r - a; echo | |
1 | |
#:~ faryne$ yq w -i sample.yaml 'c' "aaaA" |
This file contains 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
# :~ faryne$ jo -p a=1 b=2 | |
{ | |
"a": 1, | |
"b": 2 | |
} | |
# :~ faryne$ jo -p a=$(jo b=1 c=2) | |
{ |
This file contains 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
# :~ faryne$ echo '{}' | jq | |
{} | |
#:~ faryne$ echo '{"a":1}' | jq '.a' | |
1 | |
#:~ faryne$ echo '{"a":1, "b": [1, 2, 3]}' | jq '.b[2]' | |
3 |
This file contains 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
/** | |
* term:期別 | |
* num:案件數目 | |
* total:總金額 | |
*/ | |
[ | |
{ | |
"term": "2003-01", | |
"num": "166", | |
"total": "3760000" |
This file contains 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Text.RegularExpressions; | |
using System.Diagnostics; | |
namespace ConsoleApplication1 |
This file contains 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 big5_gb2312($in) | |
{ | |
return iconv('GB2312', 'UTF-8', iconv('BIG5', 'GB2312', iconv('UTF-8', 'BIG5', $in))); | |
} | |
// r簡體轉正體 | |
function gb2312_big5($in) |
This file contains 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> | |
<head> | |
<title>xxx</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/URI.js/1.18.1/URI.min.js"></script> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
$uri = URI("").addSearch("a[]", 1) | |
.addSearch("b[]", 1).toString(); |
This file contains 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
{ | |
"responses": [ | |
{ | |
"labelAnnotations": [ | |
{ | |
"mid": "/m/03q69", | |
"description": "hair", | |
"score": 0.96216953 | |
}, | |
{ |
NewerOlder