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 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 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
View ajax_css.css
/*tag name,class,id,name*/
div,.res,#res,div[name="res"]{
color: blue;
font-size: 1.2em;
}
@peter279k
peter279k / grade_v2.c
Last active Dec 10, 2015
成績系統v2
View grade_v2.c
#include <stdio.h>
#include <stdlib.h>
int main()
{
//print my title
printf("*************************************************");
printf("\t\t\t\t*");
printf("\t\t成績計算系統<v2>");
printf("\t\t*\n");
You can’t perform that action at this time.