Skip to content

Instantly share code, notes, and snippets.

@otarza
otarza / empty_database.sql
Created May 13, 2014 20:47
Mysql Delete all tables
SET FOREIGN_KEY_CHECKS = 0;
SET GROUP_CONCAT_MAX_LEN=32768;
SET @tables = NULL;
SELECT GROUP_CONCAT(table_name) INTO @tables
FROM information_schema.tables
WHERE table_schema = (SELECT DATABASE());
SELECT IFNULL(@tables,'dummy') INTO @tables;
SET @tables = CONCAT('DROP TABLE IF EXISTS ', @tables);
PREPARE stmt FROM @tables;
var win = Titanium.UI.createWindow({
title: 'Nikora',
layout: 'vertical'
});
var webview = Titanium.UI.createWebView({url:'html/index.html'});
win.add(webview);
win.open();
Remote Address:127.0.0.1:80
Request URL:http://local.tirex-api/app_dev.php/v1/customers/1
Request Method:OPTIONS
Status Code:405 Method Not Allowed
Request Headers
OPTIONS /app_dev.php/v1/customers/1 HTTP/1.1
Host: local.tirex-api
{"customer":
{
"id":1,
"name":"Cyberia",
"email":"[email protected]",
"phone":"59339459438",
"contactPerson":"Merab Zakalashvili",
"siterUrl":"http://cyberia.ge",
"logoUrl":"http://cyberia.ge/logo.png",
"projects": [1, 2, 4]
<?php
//chaagde functions.php failshi
function get_youtube_id($url) {
parse_str( parse_url( $url, PHP_URL_QUERY ), $result );
return $result['v'];
}
//gamoiyene loopshi
@otarza
otarza / wp loops
Last active August 29, 2015 13:56
// WP_Query arguments
$args = array (
'cat' => '-1',
);
// The Query
$query = new WP_Query( $args );
// The Loop
if ( $query->have_posts() ) {
@otarza
otarza / #2
Created January 28, 2014 19:26
#include<stdio.h>
#include<iostream>
using namespace std;
struct node {
int x;
node *next;
node *prev;
};
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-45966899-1']);
_gaq.push(['_setDomainName', 'unihack.ge']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
<script>
(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');
ga('create', 'UA-45966899-1', 'unihack.ge');
ga('send', 'pageview');
</script>