Skip to content

Instantly share code, notes, and snippets.

View zzbo's full-sized avatar
🎯
Focusing

zhenbo.zheng zzbo

🎯
Focusing
View GitHub Profile
@kirel
kirel / simplenote.js
Created January 14, 2012 21:15 — forked from nbqx/simplenote.js
SimpleNote API via node.js
var request = require('request'),
querystring = require('querystring');
var Note = function(key){
this.key = key;
}
Note.prototype = new process.EventEmitter();
var SimpleNote = function(email, passwd){
this.email = email;
var connect = require('connect'),
httpProxy = require('http-proxy'),
domain = process.env.DOMAIN,
port = process.env.PORT || 3000;
var proxy = new httpProxy.RoutingProxy();
connect.createServer()
.use('/api', function (req, res) {
req.headers.host = domain;
proxy.proxyRequest(req, res, { host: domain, port: 80 });
@Yimiprod
Yimiprod / difference.js
Last active November 1, 2024 06:18
Deep diff between two object, using lodash
/**
* This code is licensed under the terms of the MIT license
*
* Deep diff between two object, using lodash
* @param {Object} object Object compared
* @param {Object} base Object to compare with
* @return {Object} Return a new object who represent the diff
*/
function difference(object, base) {
function changes(object, base) {
@kirel
kirel / proxy.js
Last active May 7, 2020 06:44
Proxy for basic auth.
// Usage: USER=user PASSWORD=pw TARGET=http://localhost:3838 PORT=8080 node proxy.js
var http = require('http'),
auth = require('basic-auth'),
httpProxy = require('http-proxy');
var proxy = httpProxy.createProxyServer({});
var server = http.createServer(function(req, res) {
var credentials = auth(req)
import 'dart:js' as js;
//OR
import 'dart:html' as html;
onPressed: () {
js.context.callMethod('open', ['https://play.google.com/store']);
//OR
html.window.open('https://play.google.com/store', 'new tab');
},