Skip to content

Instantly share code, notes, and snippets.

@ikbear
ikbear / put.py
Last active December 27, 2015 08:39
上传测试 upload token
# -*- coding: utf-8 -*-
import os
import sys
import StringIO
sys.path.append("/Users/ikbear/Code/Qiniu/SDK/python-sdk/")
# @gist import_io
import qiniu.io
# @endgist
import qiniu.conf
@ikbear
ikbear / demo.py
Created September 12, 2013 07:26
Qiniu Python SDK Demo
# -*- coding: utf-8 -*-
import os
import sys
import StringIO
# @gist import_io
import qiniu.io
# @endgist
import qiniu.conf
# @gist import_rs
@ikbear
ikbear / callback.go
Last active December 22, 2015 06:58
Callback Handle
package main
import (
"encoding/base64"
"fmt"
"io/ioutil"
"net/http"
gourl "net/url"
"qbox.us/api"
"qbox.us/digest_auth"
@ikbear
ikbear / scala.rb
Created August 31, 2013 00:13 — forked from cstrahan/scala.rb
# to install the latest stable version:
brew install scala --with-docs
# to install scala-2.10.0-RC1:
brew install https://raw.github.com/gist/3939012/scala.rb --with-docs
# to switch versions (from https://github.com/mxcl/homebrew/wiki/External-Commands):
brew switch scala 2.9.2
brew switch scala 2.10.0-RC1

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discussions around concrete examples, not handy-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@ikbear
ikbear / upload.rb
Created April 28, 2013 02:36
Upload a file to qiniu cloud storage
#!/usr/bin/env ruby
require 'thor'
require 'rest_client'
require 'base64'
require 'qiniu-rs'
class QiniuUploader < Thor
desc "upload", "Upload a file to qiniu cloud storage"
def upload
bucket = 'mybucket'
@ikbear
ikbear / list.md
Created March 7, 2013 15:48 — forked from pbailis/list.md

A friend asked me for a few pointers to interesting, mostly recent papers on data warehousing and "big data" database systems, with an eye towards real-world deployments. I figured I'd share the list. While it's biased and rather incomplete but maybe of interest to someone. While many are obvious choices (I've omitted several, like MapReduce), I think there are a few underappreciated gems.

###Dataflow Engines:

Dryad--general-purpose distributed parallel dataflow engine
http://research.microsoft.com/en-us/projects/dryad/eurosys07.pdf

Spark--in memory dataflow
http://www.cs.berkeley.edu/~matei/papers/2012/nsdi_spark.pdf

@ikbear
ikbear / remove-docker-containers.md
Created November 18, 2015 05:57 — forked from ngpestelos/remove-docker-containers.md
How to remove unused Docker containers and images
  1. Delete all containers

     $ docker ps -q -a | xargs docker rm
    

-q prints only the container IDs -a prints all containers

Notice that it uses xargs to issue a remove container command for each container ID

  1. Delete all untagged images
@ikbear
ikbear / docker-clean-image.sh
Created October 20, 2015 03:38
Docker cleanup script
docker run -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker:/var/lib/docker --rm martin/docker-cleanup-volumes
@ikbear
ikbear / Gemfile
Created October 30, 2012 23:57 — forked from HungYuHei/Gemfile
followable with redis Sorted-Set
# Gemfile
gem 'redis', '~> 3.0.1'