Skip to content

Instantly share code, notes, and snippets.

View xianminx's full-sized avatar
🏠
Working from home

Lucas xianminx

🏠
Working from home
  • 10:01 (UTC +08:00)
View GitHub Profile
@xianminx
xianminx / devstore
Created August 21, 2014 02:29
devstore
开发者商店, 贩卖SDK 和组件
http://devstore.cn
https://components.xamarin.com/
Hi, you can try to place your PDF file id into the url below:
(id can be found on the Address Bar like: https://docs.google.com/file/d/ [xxxxxxxxxxxxxxx] /edit)
https://docs.google.com/viewer?srcid=[put your file id here]&pid=explorer&efh=false&a=v&chrome=false&embedded=true
then place the url into <IFRAME>:
<iframe src="https://docs.google.com/viewer?srcid=[put your file id here]&pid=explorer&efh=false&a=v&chrome=false&embedded=true" width="640px" height="480px"></iframe>
Congratulations! You can embed PDF without the left side navigator and it will automatically adjust to document width.
@xianminx
xianminx / designer.html
Last active August 29, 2015 14:08
designer
<link rel="import" href="../topeka-elements/category-icons.html">
<link rel="import" href="../core-icon/core-icon.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
@xianminx
xianminx / build.gradle
Created March 3, 2015 15:38
publish android library to bintray jcenter
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
// This is the library version used when deploying the artifact
version = "0.0.1"
group = "android.lucas"
def siteUrl = 'https://github.com/xianminx/SwipeBack'
def gitUrl = 'https://github.com/xianminx/SwipeBack.git'

下面的数据, 我如何进行这样的查询: "_id": ObjectId("55b1ea877717d27b05fd3782"), 返回title abstract 以及statements 中 "_id": ObjectId("55b1eae87717d29e05fd3785"),的数据

{
  "_id": ObjectId("55b1ea877717d27b05fd3782"),
  "title": "喷气背包是怎样从科幻小说一步步走向现实的。",
@xianminx
xianminx / resque.scala
Last active August 29, 2015 14:26 — forked from casualjim/resque.scala
A resque implementation in scala with akka actors and scala-redis
package com.mojolly.backchat
package redis
package resque
import com.mojolly.backchat.redis.resque.Resque.{ResqueWorkerActor}
import net.liftweb.json._
import JsonAST._
import JsonDSL._
import java.net.InetAddress
import com.redis.ds.{ RedisDeque, RedisDequeClient }
// use Akka actor
case class BatchTask(id: Int)
class TaskActor extends Actor {
def receive = {
case BatchTask(batchId) => new TaskWorker().run(batchId)
}
}
val taskWorker = context.actorOf(Props[TaskActor])
@xianminx
xianminx / nc.log
Last active April 7, 2016 08:06
一些简单的Linux 工具 - netcat / nc
nc — arbitrary TCP and UDP connections and listens
➜ Downloads nc baidu.com 80
GET / HTTP/1.1
User-Agent: curl/7.38.0
Host: baidu.com
Accept: */*
HTTP/1.1 200 OK
@xianminx
xianminx / App$.java
Created April 16, 2016 10:18
scala implicit conversions
public final class App$
{
public static final MODULE$;
private final int someInt;
static
{
new ();
}
@xianminx
xianminx / TestProcessPool.py
Created January 21, 2018 13:12
weird clocking in python datetime.now()
from concurrent.futures import ProcessPoolExecutor
import random,os
from datetime import datetime
import multiprocessing
from multiprocessing import Process, Queue, Manager
from multiprocessing.sharedctypes import Value, Array
import time, random
import threading