Skip to content

Instantly share code, notes, and snippets.

View yorkie's full-sized avatar
🎯
Focusing

Yorkie yorkie

🎯
Focusing
View GitHub Profile
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<!-- TemplateBeginEditable name="doctitle" -->
<title>杭州绿尚室内家居环保有限责任公司</title>
<!-- TemplateEndEditable -->
<!--<meta name="keywords" content="环保 检测 家居 绿尚 绿色 室内" />
<meta name="description" content=" 我公司主导产品定位为室内家居环保一体化服务。一体化服务是指集咨询、检测、环保产品销售、上门污染治理等独立服务为一体的新服务模式。可根据顾客不同的定位需求来设计个性化方案,挑选合适的产品来为顾客改善家居环境。为顾客解决环保问题省去了原本繁冗复杂的过程。" />
#include <math.c>
int
computeDigit(int num) {
return 1+(int)log10((float)num);
}
@yorkie
yorkie / chap1.txt
Created March 2, 2014 09:17
bash references
beginning-of-line (C-a)
Move to the start of the current line.
end-of-line (C-e)
Move to the end of the line.
forward-char (C-f)
Move forward a character.
backward-char (C-b)
@yorkie
yorkie / get_digit.c
Last active August 29, 2015 13:57
get the digit of a integer number
#include <cmath>
/*
* get the digit of a integer number
*/
static int
get_digit(int num) {
if (num == 0)
return 0;
@yorkie
yorkie / message-uv-mongo.c
Created April 13, 2014 15:37
correct message.c
#include <math.h>
#include <assert.h>
#include <net/net.h>
#include "bson.h"
#include "message.h"
#include "cursor.h"
#define Length(num) num == 0 ? 1 : (int)log10((int)num)+2;
Delivered-To: yorkiefixer@gmail.com
Received: by 10.221.16.198 with SMTP id pz6csp61182vcb;
Tue, 15 Apr 2014 02:33:54 -0700 (PDT)
X-Received: by 10.14.104.135 with SMTP id i7mr1211917eeg.34.1397554433939;
Tue, 15 Apr 2014 02:33:53 -0700 (PDT)
Return-Path: <zeromq-dev-bounces@lists.zeromq.org>
Received: from smtp.imatix.com (smtp.imatix.com. [62.176.169.64])
by mx.google.com with ESMTP id l41si24652559eef.278.2014.04.15.02.33.53
for <multiple recipients>;
@yorkie
yorkie / curl.sh
Created April 25, 2014 08:39
curl stuff
### send within data
curl -X POST -H "Content-Type: application/json"
-d '{"accessToken":"xyz","password":"xyz"}' http://www.google.com
@yorkie
yorkie / downfile.sh
Created May 1, 2014 13:08
shows how to download a file from curl
curl https://your-file-path > filename
@yorkie
yorkie / lexical-scope-in-es.js
Created May 4, 2014 16:08
it prints 10 not 20, because javascript use static(lexical) scope for function variable
var x = 10;
function foo() {
console.log(x);
}
(function(func) {
var x = 20;
foo();
package main
import (
"flag"
"net/http"
"crypto/tls"
"crypto/x509"
"io/ioutil"
"log"
)