Skip to content

Instantly share code, notes, and snippets.

View dynnamitt's full-sized avatar
:atom:
yolo

Kjetil Midtlie dynnamitt

:atom:
yolo
  • Norway
View GitHub Profile
@nz
nz / Delete all documents in a Solr index using curl.md
Last active February 12, 2024 10:55
Delete all documents in a Solr index using curl
# http://wiki.apache.org/solr/FAQ#How_can_I_delete_all_documents_from_my_index.3F
# http://wiki.apache.org/solr/UpdateXmlMessages#Updating_a_Data_Record_via_curl

curl "http://index.websolr.com/solr/a0b1c2d3/update?commit=true" -H "Content-Type: text/xml" --data-binary '<delete><query>*:*</query></delete>'

I'm amused at the traction this little gist is getting on Google! I would be remiss not to point out that six+ years later I'm still helping thousands of companies on a daily basis with their search index management, by providing managed Solr as a service over at Websolr, and hosted Elasticsearch at Bonsai. Check us out if you'd like an expert helping hand at Solr and Elasticsearch hosting, ops and support!

@mguymon
mguymon / gist:981589
Created May 19, 2011 19:56
Buildr uberjar task using one-jar
# XXX: Set the deps you want
deps = []
deps << "com.thoughtworks.xstream:xstream:jar:1.3.1"
deps << "org.quartz-scheduler:quartz:jar:1.8.5"
task :uberjar => :package do |t|
assembly_dir = "target/assembly"
FileUtils.mkdir_p( "#{assembly_dir}/lib" )
@joshbirk
joshbirk / samplerest.js
Created February 3, 2012 19:57
Sample of using passport w/ mult strategies
var fs = require("fs")
var ssl_options = {
key: fs.readFileSync('privatekey.pem'),
cert: fs.readFileSync('certificate.pem')
};
var port = process.env.PORT || 3000;
var express = require('express');
var ejs = require('ejs');
var passport = require('passport')
@avernet
avernet / gist:2025806
Created March 13, 2012 00:49
Using the exception catcher processor in XPL, with Orbeon Forms
<?xml version="1.0" encoding="utf-8"?>
<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:oxf="http://www.orbeon.com/oxf/processors">
<p:param name="instance" type="input"/>
<p:param name="data" type="output"/>
<!-- Using the URL generator, which here will 404 -->
<p:processor name="oxf:url-generator">
@DamienCassou
DamienCassou / update-emacs-ppa.sh
Last active February 20, 2016 21:26
Emacs-snapshot and emacs24 build script for Ubuntu PPA
#! /usr/bin/env bash
# Author: Damien Cassou
#
# This is the script I use to build Emacs packages for Ubuntu. These
# packages are uploaded to
# https://launchpad.net/~cassou/+archive/emacs/. Each package is
# either build from a Debian package or from
# http://emacs.naquadah.org/.
@dynnamitt
dynnamitt / gui-mergetool
Created October 23, 2012 08:37
GUI mergetool setup
sudo aptitude install meld; git config --global merge.tool meld
@jasonhwest
jasonhwest / gist:4195171
Created December 3, 2012 13:51
JavaScript: Recursive setTimeout
//original from http://www.erichynds.com/javascript/a-recursive-settimeout-pattern/
var poller = {
// number of failed requests
failed: 0,
// number of failed requests allowed
failedLimit: 10,
// starting interval - 5 seconds
@xuanlongma
xuanlongma / pandoc_multi_input.md
Last active May 1, 2024 19:18
Combine multiple input files when using Pandoc

If multiple input files are given, pandoc will concatenate them all (with blank lines between them) before parsing. -- from Pandoc website

Pandoc command: pandoc -s input1.md input2.md input3.md -o output.html

@jescalan
jescalan / stylus-plugins.md
Created January 5, 2014 01:20
Stylus Plugin Use

Stylus Plugin Use

This document will briefly review a few of the more common ways of using stylus plugins for those who are not familiar. Throughout these examples, we will be using a non-existant stylus plugin called example. Please change example out for whatever plugin you are actually trying to use!

Standalone/Node

First example is for if you are building your own stylus pipeline in node. This is a pretty standard way to do things.

@gmr
gmr / consul.lua
Created July 14, 2014 17:03
Dynamic Nginx upstream nodes using Consul
module("resty.consul", package.seeall)
_VERSION = '0.1.0'
function service_nodes(service)
local http = require "resty.http"
local json = require "cjson"
local hc = http:new()
local upstream = ""