Skip to content

Instantly share code, notes, and snippets.

View qubaomingg's full-sized avatar

qubaomingg

View GitHub Profile
@qubaomingg
qubaomingg / gist:11361274
Last active August 29, 2015 14:00
时间格式转换小工具函数
<?php
class Util_time{
public function __coustruct(){}
/**
* 计算两个时间戳相隔多少天 小时 分钟 秒 传入秒
*/
public function timediff($begin_time,$end_time) {
if($begin_time < $end_time){
$starttime = $begin_time;
@jfsiii
jfsiii / img2data.js
Created January 31, 2011 15:54
base64 encoding images in NodeJS
/*
* Complete reworking of JS from https://gist.github.com/803410
* Removes external `request` dependency
* Caveats:
* * No error checking
* * Largely a POC. `data` URI is accurate, but this code cannot simply be inserted into an `express` app
*/
var URL = require('url'),
sURL = 'http://nodejs.org/logo.png',
oURL = URL.parse(sURL),