Skip to content

Instantly share code, notes, and snippets.

View oksuz's full-sized avatar
🎯
Focusing

Yunus oksuz

🎯
Focusing
View GitHub Profile
@oksuz
oksuz / client.html
Created February 25, 2013 21:08
Cross Domain Ajax Request [JSONP]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="">
<head>
<meta httpd-equiv="content-type" content="text/html;charset=UTF-8" />
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script>
$(document).ready(function() {
$("#button").click(function() {
var surl = "http://jsonp.tld/json.php";
var id = $(this).attr("id");

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@oksuz
oksuz / gist:6654794
Created September 21, 2013 22:25
Arduino led brightness control
const int ledPin = 9;
const int switchPin = 2;
int buttonState = 0;
int multiplier = 0;
float buttonPressedCounter = 0.0;
void setup() {
pinMode(ledPin, OUTPUT);
{
"query": {
"function_score": {
"query": {
"bool": {
"must": {
"multi_match": {"query": "Renaissance", "fields": ["name", "company"]},
"term": {"features": "disability_access"},
},
"should": {
@oksuz
oksuz / install.sh
Created January 11, 2015 21:18
Required development apps
#!/bin/bash
apt-get update
add-apt-repository ppa:webupd8team/sublime-text-2
apt-get update
apt-get upgrade -y
apt-get install -y gcc gdb g++ python-software-properties openjdk-7-jre openjdk-7-jdk nginx php5-fpm php5-imagick php5-imap php5-mcrypt php5-memcached php5-memcache php5-redis php5-xdebug php5-curl php5-json php5 php5-cli php5-dev php5-gd php5-mysql php5-pgsql php5-xmlrpc php5-adodb php5-geoip php5-mongo git subversion vim php5-curl python-pip redis-server redis-tools mysql-server mysql-client ssh curl htop libsphinxclient-0.0.1 libsphinxclient-dev transmission libc6 maven tomcat7 tomcat7-docs tomcat7-admin tomcat7-examples aptitude gem nodejs ruby-dev sublime-text screen supervisor ipython
@oksuz
oksuz / sphinx_test.php
Created February 12, 2015 08:12
Sphinx Search Turkish Charset Table
<?php
header("Content-Type:text/html; charset=utf8");
$cli = new SphinxClient();
$cli->setServer("127.0.0.1", 9312);
$cli->setMatchMode(SPH_MATCH_EXTENDED2);
$result = $cli->query("bu süreçte yalnız değilsin");
var_dump($result);
/*
@oksuz
oksuz / test.php
Created October 13, 2015 16:39
dot notation to array in php
<?php
class test
{
protected $data;
public function set($key, $value)
{
$points = explode(".", $key);
$tmp =& $this->data;
@oksuz
oksuz / example input
Created December 7, 2015 17:00 — forked from omares/example input
filters
[27-May-2014 14:10:18] WARNING: [pool rebuy] child 3963 said into stderr: "NOTICE: PHP message: PHP Fatal error: Uncaught exception 'Exception' with message 'test exception' in /foo/htdocs/index.php:4"
@oksuz
oksuz / 10-php5-fpm.conf
Created December 9, 2015 08:25
multi-line php5-fpm logstash configuration
input {
beats {
port => 5044
type => "php5-fpm"
ssl => true
ssl_certificate => "/etc/pki/tls/certs/logstash-forwarder.crt"
ssl_key => "/etc/pki/tls/private/logstash-forwarder.key"
}
}