Skip to content

Instantly share code, notes, and snippets.

@learncodeacademy
learncodeacademy / webpack.config.js
Created January 8, 2016 03:55
Sample Basic Webpack Config
var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');
module.exports = {
context: __dirname,
devtool: debug ? "inline-sourcemap" : null,
entry: "./js/scripts.js",
output: {
path: __dirname + "/js",
filename: "scripts.min.js"
@mikeball
mikeball / core.clj
Last active June 3, 2020 13:22
Postgres listen/notify in Clojure using http://impossibl.github.io/pgjdbc-ng/
; Postgres listen/notify in Clojure using http://impossibl.github.io/pgjdbc-ng/
; in project.clj dependencies
; [com.impossibl.pgjdbc-ng/pgjdbc-ng "0.5"]
(ns pglisten.core
(:import [com.impossibl.postgres.jdbc PGDataSource]
[com.impossibl.postgres.api.jdbc PGNotificationListener]))
@iyedb
iyedb / nqueens.cxx
Created March 2, 2014 00:39
N Queens solution implementation in C++
#include <iostream>
#include <vector>
#include <sstream>
#include <set>
#include <cmath>
std::set<std::vector<int>> solve(int n)
{
@mumrah
mumrah / SolrUpdater.java
Last active July 13, 2016 15:13
Example of batching and multi-threading Solr updates
public static class SolrUpdater implements Runnable {
private final UpdateRequest req = new UpdateRequest();
private final SolrServer solr;
private final BlockingQueue<String> strings;
private final AtomicLong id;
private final int batchSize = 100;
private volatile int batchedUpdates = 0;
public SolrUpdater(SolrServer solr, BlockingQueue<String> strings,
AtomicLong id) {