Skip to content

Instantly share code, notes, and snippets.

View mustafauysal's full-sized avatar
💭
addressing some issues... 🧑🏻‍💻

Mustafa Uysal mustafauysal

💭
addressing some issues... 🧑🏻‍💻
View GitHub Profile
@mustafauysal
mustafauysal / commands.md
Created October 6, 2015 08:09 — forked from ondrej-kvasnovsky/commands.md
Commands to install and configure ElasticSearch on Ubuntu

Install ElasticSearch and Java

1  wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.1.deb
2  sudo dpkg -i elasticsearch-1.0.1.deb
3  sudo update-rc.d elasticsearch defaults 95 10
4  sudo add-apt-repository ppa:webupd8team/java
5  sudo apt-get update
6  sudo apt-get install oracle-java7-installer
7  java -version
@mustafauysal
mustafauysal / autocomplete.html
Created September 29, 2015 11:51 — forked from hernan/autocomplete.html
jquery autocomplete demo with custom render item implementation
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Autocomplete - Custom data and display</title>
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
<script src="../../jquery-1.6.2.js"></script>
<script src="../../ui/jquery.ui.core.js"></script>
<script src="../../ui/jquery.ui.widget.js"></script>
add_filter( 'preprocess_comment', 'nyt_preprocess_comment' );
function nyt_preprocess_comment($comment) {
if ( strlen( $comment['comment_content'] ) > 5000 ) {
wp_die('Comment is too long.');
}
return $comment;
}
@mustafauysal
mustafauysal / crontab
Last active August 29, 2015 14:17 — forked from tovbinm/crontab
# Nginx - logrotate & upload to S3
0 0 * * * /usr/sbin/logrotate /etc/logrotate.d/nginx
15 0 * * * s3cmd put /var/log/nginx/access.log-`date +"\%Y\%m\%d"`.gz s3://$LOGS_BUCKET_NAME/nginx-access/`date +"dt=\%Y\%m\%d"`/`hostname -s`.access.log-`date +"\%Y\%m\%d"`.gz
### Install OpenJDK
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Download and Install ElasticSearch
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.5.1.deb
sudo dpkg -i elasticsearch-1.5.1.deb
<?php
/**
* This file sets up exception and error handlers to log errors to our Graylog2
* server.
*
* @author Jeremy Cook
*/
//Add the autoloader generated by composer for dependencies.
require_once 'path/to/composer/autoload.php';
@mustafauysal
mustafauysal / es.sh
Last active December 27, 2015 17:39 — forked from rajraj/es.sh
cd ~
sudo yum update
sudo yum install java-1.7.0-openjdk.i686 -y
wget https://github.com/elasticsearch/elasticsearch/archive/v0.90.6.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share
<?php
/**
* Created by JetBrains PhpStorm.
* User: Yusuf Koç
* Date: 07.09.2011
* Time: 14:23
*/
class Validation