Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Chun-Sheng, Li peter279k

🎯
Focusing
Block or report user

Report or block peter279k

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View yahoo_search_sample
<!doctype html><html id="Stencil" class="NoJs" lang="zh-Hant-TW"><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"><link rel="apple-touch-icon" sizes="72x72" href="https://s.yimg.com/pv/static/img/yahoo_purple_icon_ipad_76.png" /><link rel="apple-touch-icon" sizes="144x144" href="https://s.yimg.com/pv/static/img/yahoo_purple_icon_ipad_152.png" /><meta http-equiv="x-dns-prefetch-control" content="on"><noscript><meta http-equiv="refresh" content="0;url=https://tw.search.yahoo.com/search?p=ncku&ei=UTF-8&nojs=1"></noscript><script>(function(){var o=window,m=document,q,f,i;var h=2,g="\x03",e="\x04",a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._-";function c(w){if(!w){return null}w._r=h;var x=[],t=0,s;for(s in w){var d=w[s];if(typeof d!=="string"){d=String(d);w[s]=d}if(s.length<1){return null}if(s.length>8){return null}if(s.indexOf(" ")!==-1){return null}if(n(s)||n(d)){return null}x[t++]=s}x=x.sort();var u=[];for(t=0;t<x.length;t++){u[t]=x[t]+g+w[x[t]]}u=u.join(e);if(u.le
View google_search_sample
<!doctype html><html itemscope="" itemtype="http://schema.org/SearchResultsPage" lang="zh-TW"><head><meta content="text/html; charset=UTF-8" http-equiv="Content-Type"><meta content="/images/branding/googleg/1x/googleg_standard_color_128dp.png" itemprop="image"><link href="/images/branding/product/ico/googleg_lodp.ico" rel="shortcut icon"><title>ncku - Google 搜尋</title><style>#gbar,#guser{font-size:13px;padding-top:1px !important;}#gbar{height:22px}#guser{padding-bottom:7px !important;text-align:right}.gbh,.gbd{border-top:1px solid #c9d7f1;font-size:1px}.gbh{height:0;position:absolute;top:24px;width:100%}@media all{.gb1{height:22px;margin-right:.5em;vertical-align:top}#gbar{float:left}}a.gb1,a.gb4{text-decoration:underline !important}a.gb1,a.gb4{color:#00c !important}.gbi .gb4{color:#dd8e27 !important}.gbf .gb4{color:#900 !important} </style><style>.star{float:left;margin-top:1px;overflow:hidden}._yhd{font-size:11px}.j{width:34em}#center_col b,#center_col em,#center_col strong,#rhs_block b,#rhs_block em,#rhs_b
View jqduino-sample
$(function() {
var board, led, pin = 0;
for(var i=8;i<=9;i++) {
$("#board").append("<wa-led id='" + "led" + i +"' pin='"+ i +"'></wa-led>");
}
window.addEventListener('WebComponentsReady', function () {
board = document.getElementById('board');
board.on('ready', function ready() {
$("#on-btn").click(function (event) {
View request-web
package com.example.request_web;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
View request-web-server
<?php
if(empty($_POST['user_name']) || empty($_POST["password"]))
{
echo "invalid";
}
else
{
$people = 0;
if(!file_exists("people.txt"))
{
View request-web-server 
<?php
$people = 0;
if(!file_exists("people.txt"))
{
file_put_contents("people.txt", "0");
}
else
{
$people = (int)file_get_contents("people.txt");
$people = $people + 1;
View 20151105ResolvedListener
public void initializeResolveListener() {
mResolveListener = new NsdManager.ResolveListener() {
@Override
public void onResolveFailed(NsdServiceInfo serviceInfo,
int errorCode) {
// TODO Auto-generated method stub
Log.e(TAG, "Resolve failed" + errorCode);
}
View okHTTP
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
setTitle("展覽通");
myUrlSpinner = (Spinner) findViewById(R.id.spinner);
setUrl = (Button) findViewById(R.id.button);
responseTxt = (TextView) findViewById(R.id.textView);
setUrl.setOnClickListener(listener);
myUrlSpinner.setSelection(0, true);
View okHTTP-callback.java
public void requestWeb() throws Exception {
url = "http://google.com";
Request request = new Request.Builder().url(url).build();
client.newCall(request).enqueue(new Callback() {
@Override
public void onFailure(Request request, IOException e) {
Log.e("onFailure", "onFailure exception happened");
e.printStackTrace();
}
View ajax_example.html
<!DOCTYPE html>
<html>
<head>
<title>ajax example</title>
<meta charset="utf-8" />
<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
<script>
$(function() {
//$.getJSON("http://peter279k.com/xml_converter/xml_handler.php", result);
//same function
You can’t perform that action at this time.