Skip to content

Instantly share code, notes, and snippets.

@searbe
searbe / watch_assets.sh
Created May 17, 2012 11:58
Automatically install public resources from Symfony2 bundles when a file changes
#!/bin/bash
# Useful when you're making lots of changes in bundle/Resources/public and want
# to see the changes quickly in your browser.
# chmod +x the file then call the command like `./watch_assets.sh`
# Make sure you're in the project root directory (the one containing app, src etc)
if [ -z `which inotifywait` ] ; then
echo "You must install inotify-tools to use watch_assets"
exit 1
@searbe
searbe / parse_xlsx.php
Created August 7, 2012 09:48
Parse simple XLSX in PHP with SimpleXML and ZipArchive
<?php
/**
* I had to parse an XLSX spreadsheet (which should damn well have been a CSV!)
* but the usual tools were hitting the memory limit pretty quick. I found that
* manually parsing the XML worked pretty well. Note that this, most likely,
* won't work if cells contain anything more than text or a number (so formulas,
* graphs, etc ..., I don't know what'd happen).
*/
@searbe
searbe / kubernetes-datadog-daemonset-configuration.yaml
Created February 24, 2017 11:47
Datadog Kubernetes Daemonset with configurable Kubernetes gauges
kind: ConfigMap
apiVersion: v1
metadata:
name: dd-agent-config
namespace: default
data:
kubernetes-config: |-
init_config:
instances:
- port: 4194
@searbe
searbe / gulpfile.js
Created August 20, 2017 17:59
gulp & rollup without breaking gulp streams
const gulp = require('gulp');
const uglify = require('gulp-uglify');
const sourcemaps = require('gulp-sourcemaps');
const buble = require('rollup-plugin-buble');
const commonjs = require('rollup-plugin-commonjs');
const nodeResolve = require('rollup-plugin-node-resolve');
const rollup = require('rollup-stream');
const source = require('vinyl-source-stream');
const buffer = require('vinyl-buffer');