Skip to content

Instantly share code, notes, and snippets.

@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() ) {
<?php
//chaagde functions.php failshi
function get_youtube_id($url) {
parse_str( parse_url( $url, PHP_URL_QUERY ), $result );
return $result['v'];
}
//gamoiyene loopshi
{"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]
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
var win = Titanium.UI.createWindow({
title: 'Nikora',
layout: 'vertical'
});
var webview = Titanium.UI.createWebView({url:'html/index.html'});
win.add(webview);
win.open();
@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;
{
"comment" : {
"id" : "comment id",
"text" : "comment text",
"links" : {
"topic" : "link/to/topic",
"repliedTo" : "link/to/parent/comment",
"repliesTo" : "link/to/child/comments"
}
@otarza
otarza / err.bash
Created June 21, 2014 09:06
youlisten
youlisten RDz39vZEo3-PE ./
/usr/local/lib/node_modules/youlisten/lib/youlisten.coffee:93
playlistName = get('pl-header-title')[0].textContent.trim();
^
TypeError: Cannot read property 'textContent' of undefined
at jsdom.env.done (/usr/local/lib/node_modules/youlisten/lib/youlisten.coffee:61:47)
at /usr/local/lib/node_modules/youlisten/node_modules/jsdom/lib/jsdom.js:261:9
at process._tickCallback (node.js:419:13)
@otarza
otarza / grid.css
Last active August 29, 2015 14:06
3x4 grid on drupal
.grid-wrapper ul li {
list-style: none;
float: left;
display: block;
width: 32%;
margin-right: 1%;
}
.grid-wrapper ul li img {
max-width: 100%;