Skip to content

Instantly share code, notes, and snippets.

View xiaoyao1991's full-sized avatar

Xiaoyao Qian xiaoyao1991

View GitHub Profile
@codahale
codahale / pom.xml
Last active April 20, 2024 01:38
Take this and save it as pom.xml in your project directory.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>my-project</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<!-- none yet -->
@jboner
jboner / latency.txt
Last active July 16, 2024 16:04
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@theotherian
theotherian / Jersey Resource Filters via Custom Annotations
Last active March 5, 2018 17:51
A DynamicFeature implementation for binding filters to resources with Jersey 2.0, in this case flagging certain resources as not supporting Internet Explorer 6.
Files for demonstrating custom binding of Jersey resource filters using annotations
@PeterDing
PeterDing / xiami_vip_linux.py
Last active April 9, 2017 18:34
在linux上,下载 xiami.com 320Kbps mp3 -- # 移到仓库 https://github.com/PeterDing/iScript
#!/usr/bin/env python2
# vim: set fileencoding=utf8
import re, sys, os, random, time, json, logging, argparse, requests, urllib
from mutagen.id3 import ID3,TRCK,TIT2,TALB,TPE1,APIC,TDRC,COMM,TPOS,USLT
from HTMLParser import HTMLParser
parser = HTMLParser()
s = u'\x1b[1;%dm%s\x1b[0m' # terminual color template
@jgwhite
jgwhite / example.js
Last active January 13, 2016 15:04
Ember-cli Initializer Example
// app/initializers/csrf.js
export default {
name: 'csrf',
initialize: function(container, app) {
app.inject('route', 'csrf', 'service:csrf');
app.inject('controller', 'csrf', 'service:csrf');
}
}

Credit Card Fraud Detection

This interactive Neo4j graph tutorial covers a common credit card fraud detection scenario.


检查以下文件夹删除不需要的即可以

  • ~/Library/Logs/ (我全删了,没影响)
  • ~/Library/Caches/xxxxx(使用 DaisyDisk 找到容量比较大的删除. 不会对系统有影响)
  • ~/Library/Caches/com.spotify.client(全删, 正常工作)
  • ~/Library/Caches/Google/chrome (全删, 正常工作)
  • /Applications/Google Chrome/Contents/Versions/ (只保留最新的那个文件夹, 其他的删除, 正常工作)
  • ~/Library/Developer/Xcode/DerivedData/ (全删, 正常工作.)

工具:

  • DaisyDisk 使用试用版即可,可直观查看文件(夹)大小.
@zxbodya
zxbodya / render-react-with-rxjs.md
Last active November 1, 2021 08:49
React with RxJS, reactive way :)

Observable React elements with RxJS

Note: if you want to skip history behind this, and just looking for final result see: rx-react-container

When I just started using RxJS with React, I was subscribing to observables in componentDidMount and disposing subscriptions at componentWillUnmount.

But, soon I realised that it is not fun to do all that subscriptions(that are just updating property in component state) manually, and written mixin for this...

Later I have rewritten it as "high order component" and added possibility to pass also obsarvers that will receive events from component.

浅谈《【原创】深度分析Twitter Heron》

有幸拜读了《【原创】深度分析Twitter Heron》 ( http://www.longda.us/?p=529 )一文,十分感动国内社区对Heron的关注。但此文中有诸多重要问题值得商榷,我谨在此行文指出,还望能够帮助大家更好的理解Heron。转载烦请注明出处:https://gist.github.com/maosongfu/c3aeb1bb5eb7b39fcdc5

我是符茂松,目前在Twitter工作,是Heron的作者之一。这个领域水深,我也是初窥门径,希望能够与大家多多交流。

微博:符茂松

Twitter: Louis_Fumaosong

@pgaref
pgaref / gist:7ed87e47cd735a423e70
Last active September 18, 2018 10:10
Jmeter running out of addresses
java.net.NoRouteToHostException: Cannot assign requested address: JMeter server is unable to allocate a port to create a connection to the JMeter client to return the samples.
Same thing happened to Nginx front-end as well!
java.net.NoRouteToHostException: Cannot assign requested address
Otherwise, the following messages may appear in the JMeter JTL files:
Non HTTP response code: java.net.BindException
Non HTTP response message: Address already in use
The solution is to enable fast recycling TIME_WAIT sockets.