Skip to content

Instantly share code, notes, and snippets.

View junyuecao's full-sized avatar

JunyueCao junyuecao

View GitHub Profile
@staltz
staltz / introrx.md
Last active May 3, 2024 13:00
The introduction to Reactive Programming you've been missing
Number Name Score Regex Length All match? Credit
 1 | Plain Strings| 207 | `foo`                                              | 3      | Yes        | 
 2 | Anchors      | 208 | `k$`                                               | 2      | Yes        |
 3 | Ranges       | 202 | `^[a-f]*$`                                         | 8      | Yes        |
 4 | Backrefs     | 201 | `(...).*\1`                                        | 9      | Yes        | gorhill (HN)
 5 | Abba         | 193 | `^(?!.*(.)(.)\2\1)`                                | 17     | Yes        | chingjun (HN) / josephlord (HN) 
 6 | A man, a plan| 177 | `^(.)[^p].*\1$`                                    | 13     | Yes        | hyp0 (HN)

7 | Prime | 286 | ^(?!(..+)\1+$) | 14 | Yes | josephlo

@ebidel
ebidel / Web Components Resources.md
Last active February 27, 2023 22:04
List of resources related to Web Components
@ficusk
ficusk / GsonRequest.java
Last active April 9, 2024 09:03
A Volley adapter for JSON requests that will be parsed into Java objects by Gson.
import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;
import com.android.volley.AuthFailureError;
import com.android.volley.NetworkResponse;
import com.android.volley.ParseError;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.Response.ErrorListener;
import com.android.volley.Response.Listener;
@domenic
domenic / q-mongoose-so.js
Last active August 24, 2017 05:49
Q + Mongoose from StackOverflow
var mongoose = require('mongoose');
mongoose.connect('mongo://localhost/test');
var conn = mongoose.connection;
var users = conn.collection('users');
var channels = conn.collection('channels');
var articles = conn.collection('articles');
var insertUsers = Q.nfbind(users.insert.bind(users));
var insertChannels = Q.nfbind(channels.insert.bind(channels));