Skip to content

Instantly share code, notes, and snippets.

@glensc
glensc / README.md
Last active August 29, 2015 13:58
MATE Desktop in PLD Linux

MATE Desktop in PLD Linux

To build this VM and create vagrant-mate base box:

First clone this repository:

git clone https://gist.github.com/glensc/9948541 vagrant-mate
cd vagrant-mate
/vendor/
/bin/
/composer.phar
*~
*.sw[op]
@glensc
glensc / XmlParser.php
Created April 28, 2014 14:48
Overly simple XML parser.
<?php
/**
* Overly simple XML parser.
*
* Does not parse CDATA nor nested tags well
*
* @author Elan Ruusamäe <glen@delfi.ee>
*/
class XmlParserException extends RuntimeException {
@glensc
glensc / README.md
Created May 13, 2014 18:25
vim script to prevent edits to Chef generated files

copy noedit.vim to $VIMRUNTIME/plugin/noedit.vim or just include in your ~/.vimrc file

Mon Mar 22 15:25:10 EET 2010
diff --git a/min/lib/Minify/HTML/Helper.php b/min/lib/Minify/HTML/Helper.php
index 807fdc9..f199ac4 100644
--- a/min/lib/Minify/HTML/Helper.php
+++ b/min/lib/Minify/HTML/Helper.php
@@ -69,7 +69,7 @@ class Minify_HTML_Helper {
if ($debug) {
$path .= "&debug";
} elseif ($farExpires && $this->_lastModified) {
- $path .= "&" . $this->_lastModified;
+ $path .= "&" . ($this->_lastModified + $this->_filePathChecksum);
@glensc
glensc / README.md
Created November 20, 2012 22:31
Closure Compiler as Simple HTTP Server
@glensc
glensc / .gitignore
Last active December 11, 2015 07:28 — forked from petterl/create_repo.sh
eventum bzr to git migrate
eventum.bzr
@glensc
glensc / index.php
Created April 20, 2016 17:59
GitHub Push Hook PHP Handler
<?php
// https://developer.github.com/webhooks/
// ruby -rsecurerandom -e 'puts SecureRandom.hex(20)'
define('HOOK_SECRET', '');
set_exception_handler(function($e) {
header('HTTP/1.1 500 Internal Server Error');
error_log(basename(__FILE__, '.php') . ': '. $e->getMessage());
die("Error on line {$e->getLine()}: " . htmlspecialchars($e->getMessage()));
@glensc
glensc / slack-svn-hook.py
Last active January 31, 2017 14:35
Subversion integration with Slack
#!/usr/bin/python
# Script for Subversion integration with Slack
#
# Uses slackweb module:
# https://github.com/satoshi03/slack-python-webhook
# 1. Save this file in /usr/bin as slack-svn-hook
# 2. Make it executable:
# chmod +x /usr/bin/slack-svn-hook
# 3. Put this line at the end of file of your_svn_repo/hooks/post-commit: