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
// declare two types | |
type PagerData struct { | |
Objects []interface{} | |
Total int | |
} | |
type User struct { | |
Name string | |
} |
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
zval *names; | |
MAKE_STD_ZVAL(names); | |
array_init(names); | |
/** | |
* assign names to return_value | |
*/ | |
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
func (mj *Mj) LoadWithPager(offset, limit int) []MeijuTable { | |
dsn := mj.GetDSN() | |
fmt.Println(dsn) | |
db, err := sql.Open(dsn) | |
fmt.Println(err) | |
if err != nil { | |
mj.Panic(err) | |
} | |
defer db.Close() |
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
// | |
// ipshow.c | |
// IPSHOW | |
// | |
// Created by Jackey Chen on 8/18/15. | |
// Copyright (c) 2015 Jackey Chen. All rights reserved. | |
// | |
#include <stdio.h> | |
#include <string.h> |
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 ( | |
"bufio" | |
"net" | |
) | |
type Client struct { | |
incoming chan string | |
outgoing chan string |
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
# chkconfig: 3 66 40 | |
# description: httpsqs | |
# processname: httpsqs | |
# config: | |
# Source function library | |
. /etc/rc.d/init.d/functions | |
RETVAL=0 | |
prog="httpsqs" |
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 language($value,$from="auto",$to="auto") | |
{ | |
$value_code=urlencode($value); | |
#首先对要翻译的文字进行 urlencode 处理 | |
$appid="ZuVRDtLTr1PXxz7g028BUPYL"; | |
#您注册的API Key | |
$languageurl = "http://openapi.baidu.com/public/2.0/bmt/translate?client_id=" . $appid ."&q=" .$value_code. "&from=".$from."&to=".$to; | |
#生成翻译API的URL GET地址 | |
$text=json_decode(language_text($languageurl)); |
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
[field_shen_image] => Array | |
( | |
[und] => Array | |
( | |
[1] => Array | |
( | |
[width] => 500 | |
[_weight] => 1 | |
[display] => 1 | |
[fid] => 486 |
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
stdClass Object | |
( | |
[pagination] => stdClass Object | |
( | |
[next_max_tag_id] => 1387972498648 | |
[deprecation_warning] => next_max_id and min_id are deprecated for this endpoint; use min_tag_id and max_tag_id instead | |
[next_max_id] => 1387972498648 | |
[next_min_id] => 1387972509152 | |
[min_tag_id] => 1387972509152 | |
[next_url] => https://api.instagram.com/v1/tags/snow/media/recent?count=0&client_id=6c474f0f5dbd49af824803a47de955ee&max_tag_id=1387972498648 |
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
# Something in lines of http://stackoverflow.com/questions/348630/how-can-i-download-all-emails-with-attachments-from-gmail | |
# Make sure you have IMAP enabled in your gmail settings. | |
# Right now it won't download same file name twice even if their contents are different. | |
import email | |
import getpass, imaplib | |
import os | |
import sys | |
detach_dir = '.' |