This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach ($form->getMessages() as $fieldName => $errorMessages) { | |
foreach ($errorMessages as $messageKey => $message) { | |
echo $fieldName.': '.$messageKey.' -> '.$message.'<br />'; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#to use rails you need to compile rvm with ssl and readline | |
#http://dev.mensfeld.pl/2011/06/rvm-i-no-such-file-to-load-openssl/ | |
#https://rvm.beginrescueend.com/packages/openssl/ | |
#sudo apt-get install openssl libssl-dev libreadline6-dev | |
rvm pkg install openssl | |
rvm pkg install readline | |
rvm remove 1.9.2 | |
rvm cleanup all | |
rvm install 1.9.2 --with-openssl-dir=$rvm_path/usr, --with-readline-dir=$rvm_path/usr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem list | cut -d" " -f1 >> gemslist.txt | |
#remove from this gems You want to leave | |
more gemslist.txt | xargs gem uninstall -aIx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# if running bash | |
if [ -n "$BASH_VERSION" ]; then | |
# include .bashrc if it exists | |
if [ -f "$HOME/.bashrc" ]; then | |
. "$HOME/.bashrc" | |
fi | |
fi | |
# Set PATH so it includes user's private bin if it exists | |
if [ -d "$HOME/bin" ] ; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Compile with | |
// gcc -o /etc/bin/autossh autossh.c | |
#include <stdio.h> | |
int main(int argc, char *argv[]) { | |
while(1) { | |
sleep(60); | |
printf(".\n"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://www.varnish-software.com/static/book/Getting_started.html#varnishlog | |
# View requests which are comming from the user to varnish | |
varnishlog -c -i RxURL | |
# View requests which are going from varnish to the backend | |
varnishlog -b -i TxURL | |
# BAN many objects at once - remember to implement the ban functionality in the /etc/varnish/default.vcl | |
curl -X BAN -H 'Host: some.host.net' 'http://localhost:80/url/.*' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env ruby | |
# encoding: utf-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
backend jsonp_varnish { | |
.host = "localhost"; | |
.port = "80"; | |
} | |
#------------- begin jsonp functionality -------------# | |
# How the jsonp_template_backend dispatches to the ESI generating code: | |
sub jsonp_throw_error_recv { | |
if (req.url == "/JSONP-ESI-TEMPLATE") { | |
error 760; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
/* | |
* jQuery File Upload Plugin Node.js Example 2.1.0 | |
* https://github.com/blueimp/jQuery-File-Upload | |
* | |
* Copyright 2012, Sebastian Tschan | |
* https://blueimp.net | |
* | |
* Licensed under the MIT license: | |
* http://www.opensource.org/licenses/MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var gaProperty = 'UA-65367173-1'; | |
var gaDisableCookieName = 'ga-disable-' + gaProperty; | |
// Disable Google Analytics if the user opted for this - this information is saved in the cookie | |
if ( document.cookie.indexOf(gaDisableCookieName + '=true') === -1 ) { | |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | |
})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); |
OlderNewer