Skip to content

Instantly share code, notes, and snippets.

View vranac's full-sized avatar

Vranac Srdjan vranac

  • Novi Sad, Vojvodina, Serbia
View GitHub Profile
{
"github-oauth": {
"github.com": "YOUR_OAUTH_TOKEN_HERE"
}
}
<?php
session_start();
$db= mysqli_connect('localhost', 'korisnik1', '12345', 'baza1');
if(isset($_POST['send'])){
$pass=addslashes($_POST['pass']);
$sql=" SELECT * FROM baza1 WHERE pass='$pass' ";
$result=mysqli_query($db,$sql);
if(mysqli_num_rows($result)==1){
begin
declare continue handler for sqlstate '42710' begin end;
execute immediate 'create table versions(name varchar(255)) in userspace1';
execute immediate 'insert into versions values (''component-name'')';
end/
[vagrant@vagrant-centos65 ~]$ sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
Retrieving http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
Preparing... ########################################### [100%]
package epel-release-6-8.noarch is already installed
@vranac
vranac / relations
Last active August 29, 2015 14:10
Neo4j relationships
CREATE INDEX ON :Airport(IataCode);
CREATE INDEX ON :Deal(OriginId);
CREATE INDEX ON :Deal(DestinationId);
MATCH (ao:Airport),(d:Deal)
WHERE d.OriginId = ao.IataCode
MERGE (ao)-[ro:ORIGIN]->(d);
MATCH (ad:Airport),(d:Deal)
WHERE d.DestinationId = ad.IataCode
CREATE CONSTRAINT ON (deal:Deal) ASSERT deal.id IS UNIQUE;
USING PERIODIC COMMIT 5000
LOAD CSV WITH HEADERS FROM "file:///Users/vranac/dev/deals/temp/deals_100k.csv" AS row
WITH row
MERGE (d:Deal {Id: row.id})
ON CREATE SET d.Id = row.id,
d.a = row.a,
d.b = row.b,
// 2014-12-05,
public function testInsertingSomething()
{
$something = array(
'something_id' => 123,
'someother_value' => 10
);
$dbMock = m::mock('Zend_Db_Adapter_Mysqli');
$dbMock->shouldReceive('fetchOne')
->with('SELECT something_id FROM somethings WHERE something_id = ?', 123)
<?php
interface iPropulsion
{
public function accelerate();
public function decelerate();
}
interface iOrdonance
{
± vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Resuming suspended VM...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2200
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Connection refused. Retrying...
==> default: Machine booted and ready!
vranac at vurunica in ~
○ memtest all
Memtest version 4.22 (64-bit)
Copyright (C) 2004 Charles Cazabon
Copyright (C) 2004-2008 Tony Scaminaci (Macintosh port)
Licensed under the GNU General Public License version 2 only
Mac OS X 10.9.3 (13D65) running in multiuser mode
Memory Page Size: 4096