Skip to content

Instantly share code, notes, and snippets.

View micron's full-sized avatar

Miron micron

  • kreativrudel
  • Siegburg
View GitHub Profile
var zlib = require('zlib');
var gzip = zlib.createGzip();
var input = 'file not found';
var compressed = '';
zlib.deflate(input, function(err, buffer){
console.log(buffer);
console.log(buffer.toString());
console.log(buffer.toString('base64'));
compressed = buffer.toString('base64');
@micron
micron / getAngularInjector
Created February 5, 2014 16:03
Useful Chrome DevTools Snippets
// if you need the injector from the console
var injector = angular.element('html').injector();
// you can then do something like:
// var dateFilter = injector.get('dateFilter');
// dateFilter('date', 'type');
@micron
micron / Copy files
Created October 14, 2013 22:47
A small script for copying config files on an server to the right location
#!/bin/bash
# point to the directory where the config files are stored
CONFIG_DIR="/path/to/your/dir/"
cd $CONFIG_DIR
if [ "$1" == "" ]; then
DIRECTORY=$(ls -al | awk '{print $1,$9}' | grep -i ^\- | awk '{print $2}');
else