Skip to content

Instantly share code, notes, and snippets.

View abruzzi's full-sized avatar
⌨️
Writing a React book - React Anti-Patterns

Juntao Qiu abruzzi

⌨️
Writing a React book - React Anti-Patterns
View GitHub Profile
@abruzzi
abruzzi / Issues.md
Created September 23, 2015 09:17 — forked from rclark/Issues.md
Leaflet WMS + GetFeatureInfo

There are a bunch of reasons why this is convoluted, mostly in building the URL to make the request:

  1. You have to rely on an AJAX request, this example uses jQuery
  2. To make a GetFeatureInfo request, you must provide a BBOX for a image, and the pixel coordinates for the part of the image that you want info from. A couple of squirrely lines of Leaflet code can give you that.
  3. Output formats. The info_format parameter in the request. We don't know a priori which will be supported by a WMS that we might make a request to. See Geoserver's docs for what formats are available from Geoserver. That won't be the same from WMS to WMS, however.
  4. WMS services return XML docs when there's a mistake in the request or in processing. This sends an HTTP 200, which jQuery doesn't think is an error.
@abruzzi
abruzzi / gist:6d936b6a8a56d41dac01
Created October 7, 2015 12:09 — forked from Liutos/gist:3726523
照着垠神的λ-calculus解释器用CommonLisp写的
(defpackage :com.liutos.del0-interp
(:use :cl)
(:nicknames :del0-interp
:interp))
(in-package :interp)
(defvar *env0* '())
(defun ext-env (x v env)
@abruzzi
abruzzi / gist:d3abc9cce7f1e091f572
Created October 14, 2015 09:52 — forked from phillro/gist:1193227
Elasticsearch autocomplete example with cross origin resource sharing
<html>
<head>
<link rel="stylesheet" href="/examples/stylesheets/ui-lightness/jquery-ui-1.8.16.custom.css" type="css">
<script type="text/javascript" src="/examples/javascripts/jquery.min.js"></script>
<script type="text/javascript" src="/examples/javascripts/jquery.base64.min.js"></script>
<script type="text/javascript" src="/examples/javascripts/jquery-ui-1.8.16.custom.min.js"></script>
<script type="text/javascript" src="/examples/javascripts/jquery.tmpl.min.js"></script>
</head>
<body>
@abruzzi
abruzzi / gist:c77d807a3f2578b3e000
Created October 19, 2015 00:56 — forked from afair/gist:3803895
PostgreSQL and Pgpool Architecture

Hey! I saw this has been indexed by the search engines. It is a first draft of a post I ended up publishing on my blog at: Scaling PostgreSQL With Pgpool and PgBouncer

Thanks for stopping by!

PostgreSQL and Pgpool Architecture

@abruzzi
abruzzi / gulpfile.js
Created November 9, 2015 01:46 — forked from danharper/gulpfile.js
New ES6 project with Babel, Browserify & Gulp
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require('babelify');
function compile(watch) {
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel));
@abruzzi
abruzzi / build.gradle
Created December 19, 2015 07:04
Findbugs and PMD with Android Gradle Plugin
//Thanks to https://github.com/stephanenicolas/Quality-Tools-for-Android/blob/master/build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.7.+'
}
}
@abruzzi
abruzzi / gist:7b75f60f82584d3405e6e5937918bc83
Created May 5, 2016 12:07 — forked from rnorth/gist:2031652
Cookie-based authentication with nginx
worker_processes 1;
error_log logs/error.log;
events {
worker_connections 1024;
}
@abruzzi
abruzzi / Doxyfile
Created December 6, 2016 10:57 — forked from atneik/Doxyfile
Ideal Doxyfile
# Doxyfile 1.7.5.1
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
#
# All text after a hash (#) is considered a comment and will be ignored.
# The format is:
# TAG = value [value, ...]
# For lists items can also be appended using:
# TAG += value [value, ...]
@abruzzi
abruzzi / BankAccount.java
Created January 3, 2017 06:39 — forked from kt3k/BankAccount.java
BankAccount DCI example in Java
package org.kt3k.bankaccount;
public class BankAccount {
private String id;
private Integer balance;
public BankAccount(String id, Integer balance) {
this.id = id;
this.balance = balance;
@abruzzi
abruzzi / sigma.fruchterman.js
Created May 25, 2017 07:47 — forked from sheymann/sigma.fruchterman.js
Fruchterman-Reingold layout plugin for Sigma.js with automatic cooling and stopping condition.
/**
* Linkurious 2012, all rights reserved.
* Sébastien Heymann <seb@linkurio.us>,
* Romain Yon <romain@linkurio.us>
*
* Please use http://jsbeautifier.org/ and indent with 2 spaces.
*
* Lib docs:
* http://twitter.github.com/bootstrap/
* http://docs.jquery.com/