Skip to content

Instantly share code, notes, and snippets.

@jordansissel
jordansissel / apachedashboard.json
Created March 21, 2014 23:09
Kibana 3.0.0 dashboard for Apache access logs w/ default 'combined' apache log format. Parsed with logstash 1.4.0 using grok, date, geoip, and useragent filters.
{
"title": "Apache Overview",
"services": {
"query": {
"list": {
"2": {
"id": 2,
"type": "topN",
"query": "",
"alias": "",
@chucknado
chucknado / main.js
Last active January 20, 2017 21:32
A Zendesk app for a tutorial on adding OAuth at https://support.zendesk.com/hc/en-us/articles/205225558
$(function() {
var client = ZAFClient.init();
client.invoke('resize', {width: '100%', height: '400px'});
showStart();
$("#check-token").click(function (event) {
event.preventDefault();
client.invoke('notify', 'Authenticating...');
<?php
/**
* Lists bundles that have a field of type image or file for D7.29 regression
* https://www.drupal.org/node/2305017
*
* Download this script on your server/localhost and run
* drush php-script 2305017_file_lost.php
*/
@rshk
rshk / kibana-apache-logs.json
Created May 6, 2014 16:16
Kibana: analyze Apache logs
{
"title": "Apache logs",
"services": {
"query": {
"list": {
"0": {
"query": "*",
"alias": "",
"color": "#7EB26D",
"id": 0,
@typhonius
typhonius / seed_derivatives.drush.inc
Last active January 27, 2021 10:01
This script can generate image derivatives for Drupal for warming up the filesystem prior to going live. Image derivative generation puts an amount of load on the servers so it images have been migrated from another server with no derivatives, it may be useful to pre-generate using this script.
<?php
/**
* Implements hook_drush_command().
*/
function seed_derivatives_drush_command() {
$items = array();
$items['seed_derivatives'] = array(
'description' => "Create image derivatives",
@w00fz
w00fz / sphp.sh
Last active February 7, 2022 00:12
PHP switcher
#!/bin/bash
# Check if command was ran as root.
if [[ $(id -u) -eq 0 ]]; then
echo "The command \"sphp\" should not be executed as root or via sudo directly."
echo "When a service requires root access, you will be prompted for a password as needed."
exit 1
fi
# Usage
@trdarr
trdarr / hubot-digitalocean.md
Last active March 28, 2022 20:34
Deploying Hubot on DigitalOcean (with Slack integration)
@remi
remi / commit-msg
Created August 30, 2011 20:56
Git commit message spell check hook (kind of a proof of concept, but still usable)
#!/usr/bin/env ruby
# 1. Install hunspell
# $ brew install hunspell
# 2. Download a dictionary and install it in a path listed by `hunspell -D`
# $ open http://wiki.services.openoffice.org/wiki/Dictionaries
# 3. Move this file into your repository
# $ mv commit-msg /path/to/repo/.git/hooks
@adactio
adactio / basicServiceWorker.js
Last active March 27, 2023 09:30
A basic Service Worker, for use on, say, a blog.
'use strict';
// Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
// http://creativecommons.org/publicdomain/zero/1.0/
(function() {
// Update 'version' if you need to refresh the cache
var staticCacheName = 'static';
var version = 'v1::';
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')