Skip to content

Instantly share code, notes, and snippets.

View paullinney's full-sized avatar

Paul Linney paullinney

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!

@basdenooijer
basdenooijer / 1-configureAdapterInstance.php
Created March 30, 2011 07:44
Solarium client adapter ZendHttp examples
<?php
// this example assumes Solarium and Zend_Framework are in your include_path
// make Solarium available
require('Solarium/Autoloader.php');
Solarium_Autoloader::register();
// make Zend Framework available
require('Zend/Loader/Autoloader.php');
@anhang
anhang / localStorage.js
Created July 20, 2011 23:07
HTML5 Local Storage with Expiration
AZHU.storage = {
save : function(key, jsonData, expirationMin){
if (!Modernizr.localstorage){return false;}
var expirationMS = expirationMin * 60 * 1000;
var record = {value: JSON.stringify(jsonData), timestamp: new Date().getTime() + expirationMS}
localStorage.setItem(key, JSON.stringify(record));
return jsonData;
},
load : function(key){
if (!Modernizr.localstorage){return false;}
@l15n
l15n / git-branches-by-commit-date.sh
Created July 13, 2012 08:47 — forked from jasonrudolph/git-branches-by-commit-date.sh
List remote Git branches and the last commit's author and author date for each branch. Sort by most recent commit's author date.
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ai %ar by %an" $branch | head -n 1` \\t$branch; done | sort -r
@fraga
fraga / get_all_commits_per_user.sh
Last active January 5, 2018 15:34
Git command to count all commits per user on a repo
git log --pretty=format:"%an"| env LC_ALL=C sort| env LC_ALL=C uniq -c| env LC_ALL=C sort -r
@barryvdh
barryvdh / _ide_helper.php
Last active May 6, 2024 07:45
Laravel IDE Helper for Netbeans / PhpStorm / Sublime Text 2 CodeIntel, generated using https://github.com/barryvdh/laravel-ide-helper
<?php
/**
* A helper file for Laravel 5, to provide autocomplete information to your IDE
* Generated for Laravel 5.5.13 on 2017-09-28.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
namespace {
exit("This file should not be included, only analyzed by your IDE");
@johnkary
johnkary / Request.php
Created December 4, 2013 03:59
Example of how to request raw XML via a SoapClient
<?php
use Psr\Log\LoggerInterface;
/**
* Assembles and dispatches the SOAP request body XML and returns the
* Response body XML from the vendor API.
*/
class Request
{
@Souvent22
Souvent22 / gist:ca9ad74b3ae2ae35726e
Last active August 29, 2015 14:02
Snipppets for DrupalCon Austin
## APACHE BENCH COMMANDS
ab -c 25 -n 100 http://localhost/heavy
ab -c 25 -n 100 http://localhost
# This are snippets for DrupalCon.
# Bitly link: http://bit.ly/DDAustin
# Files: http://www.earnestberry.com/austintalk.zip
# <esi:include src="/robots.txt" />
# White list items
@joachim-n
joachim-n / gist:989eb0d1ca54ce756350
Created February 3, 2015 13:08
Drush shell script to diff and write a patch file.
#!/usr/bin/env drush
<?php
/**
* @file
* Drush shell script for creating a patch.
* Requires the following setup:
* - You are on a git feature branch for your issue.
* - The branch name is of the format '1234-description-of-feature' where 1234
* is the drupal.org issue number.
* - The feature branch is rebased to the major development branch you want to
@alberto56
alberto56 / set-up-letsencrypt-acquia-stage.sh
Last active August 20, 2021 15:46
Scripts semi-automating settings up LetsEncrypt for Acquia Stage environments (see http://blog.dcycle.com/blog/2018-10-05/https-acquia-stage/)
#!/bin/bash
#
# Script semi-automating the process of adding LetsEncrypt certificates to
# serve Acquia staging sites in HTTPS.
# See http://blog.dcycle.com/blog/2018-10-05/https-acquia-stage/
#
set -e
BASE="$PWD"