post-checkout.sh
uložit jako.git/hooks/post-checkout
.invalidate-opcache.php
jakowww/.invalidate-opcache.php
(POZOR! - tenhle soubor buďto na produkci nenahrávat, nebo zablokovat přístup!)
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
# [Mon Jan 16 11:23:14 2012] Protocol: http, Server: 192.168.5.10:9200 | |
curl -XPUT 'http://127.0.0.1:9200/users/?pretty=1' -d ' | |
{ | |
"mappings" : { | |
"info" : { | |
"_all" : { | |
"type" : "string", | |
"analyzer" : "uax_url_email" | |
}, | |
"properties" : { |
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
// 1) Lets start with the simplest query that you can run in | |
// the head plugin for ElasticSearch located at the url: | |
// http://localhost:9200/_plugin/head/ | |
{ | |
"query": { | |
"match_all": {} | |
} | |
} | |
// 2) Before jumping into forming queries with the ES Query DSL |
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
<?php | |
require 'nette.phar'; | |
//Tracy\Debugger::enable(); | |
$dns = "mysql:host=localhost;dbname=database"; | |
$user = "user"; | |
$password = "*****"; |
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/sh | |
# Save as .git/hooks/post-merge | |
# Set execute bit like: chmod ug+x .git/hooks/post-merge | |
purgePath="temp/cache" | |
echo | |
echo -n "HOOK [Purge cache]: " | |
if [ -d "$purgePath" ]; 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
<? php | |
public static function getAllIndicatorValuesOverview($userId = null) { | |
$surveys = self::getConnection()->query( | |
'SELECT surveys.surveyId,surveys.year,user.organizationName | |
FROM surveys | |
LEFT JOIN user ON surveys.userId=user.userId' | |
)->fetchAll(); | |
foreach($surveys as &$survey) { |
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
error_log syslog:server=unix:/var/log/nginx.sock; | |
http { | |
log_format verbose '$remote_addr - $remote_user $host "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"'; | |
map $status $loggable { | |
~^[2] 0; | |
default 1; | |
} |
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
<?php | |
function cidr_match($ip, $ranges) | |
{ | |
$ranges = (array)$ranges; | |
foreach($ranges as $range) { | |
list($subnet, $mask) = explode('/', $range); | |
if((ip2long($ip) & ~((1 << (32 - $mask)) - 1)) == ip2long($subnet)) { | |
return true; | |
} | |
} |
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
/** | |
* api/models/User.js | |
* | |
* The user model contains the instance method for validating the password. | |
*/ | |
var bcrypt = require('bcrypt'); | |
function hashPassword(values, next) { | |
bcrypt.hash(values.password, 10, function(err, hash) { |
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
VERSION=0.20.6 | |
sudo apt-get update | |
sudo apt-get install openjdk-6-jdk | |
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-$VERSION.deb | |
sudo dpkg -i elasticsearch-$VERSION.deb | |
# be sure you add "action.disable_delete_all_indices" : true to the config!! |
OlderNewer