Skip to content

Instantly share code, notes, and snippets.

View yorkie's full-sized avatar
🎯
Focusing

Yorkie Makoto yorkie

🎯
Focusing
View GitHub Profile
@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 / 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
Delivered-To: [email protected]
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: <[email protected]>
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 / 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;
@yorkie
yorkie / 1.eml
Created April 11, 2014 05:10
twitter
Delivered-To: [email protected]
Received: by 10.220.91.9 with SMTP id k9csp226151vcm;
Tue, 1 Apr 2014 11:59:42 -0700 (PDT)
X-Received: by 10.66.161.38 with SMTP id xp6mr4948165pab.145.1396378781951;
Tue, 01 Apr 2014 11:59:41 -0700 (PDT)
Return-Path: <[email protected]>
Received: from spruce-goose-aq.twitter.com (spruce-goose-aq.twitter.com. [199.59.150.86])
by mx.google.com with ESMTPS id tk5si11770661pbc.80.2014.04.01.11.59.41
for <[email protected]>
@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 / 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)
#include <math.c>
int
computeDigit(int num) {
return 1+(int)log10((float)num);
}
<!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=" 我公司主导产品定位为室内家居环保一体化服务。一体化服务是指集咨询、检测、环保产品销售、上门污染治理等独立服务为一体的新服务模式。可根据顾客不同的定位需求来设计个性化方案,挑选合适的产品来为顾客改善家居环境。为顾客解决环保问题省去了原本繁冗复杂的过程。" />
@yorkie
yorkie / random-timer.js
Created January 29, 2014 03:43
random timer
function startTimer(fn) {
var interval = Math.random()*100;
console.log('interval:',interval);
var timer = setTimeout(function() {
fn();
startTimer(fn);
}, interval);
}