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
/* | |
* Copyright 2014 Julian Shen | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
package main | |
import ( | |
"fmt" | |
"image/jpeg" | |
"io/ioutil" | |
"log" | |
"net/http" | |
"os" | |
"path/filepath" |
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
package main | |
import "fmt" | |
func Merge(ldata []int, rdata []int) (result []int) { | |
result = make([]int, len(ldata) + len(rdata)) | |
lidx, ridx := 0, 0 | |
for i:=0;i<cap(result);i++ { | |
switch { |
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
function _strstr(str1, str2){ | |
var i = 0; | |
for(var c of str2) { | |
if(str1[i++] != c) { | |
return false; | |
} | |
} | |
return true; | |
} |
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
package com.htc.blinkfeed.sample.vimeo.api; | |
import java.io.IOException; | |
import java.net.HttpURLConnection; | |
import oauth.signpost.OAuthConsumer; | |
import oauth.signpost.basic.DefaultOAuthConsumer; | |
import oauth.signpost.exception.OAuthCommunicationException; | |
import oauth.signpost.exception.OAuthExpectationFailedException; | |
import oauth.signpost.exception.OAuthMessageSignerException; |
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
function isPrime(n) { | |
if(isNaN(n) || !isFinite(n) || n%1 || n<2) { | |
return false; | |
} | |
if(n%2==0) return (n==2); | |
if(n%3==0) return (n==3); | |
var m = Math.sqrt(n); | |
for(var i = 5 ; i < m; i++) { |
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
// | |
// ViewController.swift | |
// mapanitest | |
// | |
// Created by Julian Shen on 2016/10/4. | |
// Copyright © 2016年 cowbay.wtf. All rights reserved. | |
// | |
import UIKit | |
import MapKit |
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
package main | |
import ( | |
"crypto/md5" | |
"encoding/json" | |
"errors" | |
"fmt" | |
"io" | |
"log" | |
"regexp" |
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
package main | |
import ( | |
"fmt" | |
"github.com/SlyMarbo/rss" | |
"github.com/julianshen/go-readability" | |
"github.com/parnurzeal/gorequest" | |
"github.com/yanyiwu/gojieba" | |
) |
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
package main | |
import ( | |
"fmt" | |
"github.com/alexjlockwood/gcm" | |
) | |
func main() { | |
// Create the message to be sent. | |
data := map[string]interface{}{"push_id": "10131233", "time": "2016-02-23T06:43:13.265Z", "data": "{'title':'test'}"} regIDs := []string{"device-token-y5g"} |
NewerOlder