Skip to content

Instantly share code, notes, and snippets.

Vranac Srdjan vranac

  • Novi Sad, Vojvodina, Serbia
Block or report user

Report or block vranac

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View auth.json.dist
{
"github-oauth": {
"github.com": "YOUR_OAUTH_TOKEN_HERE"
}
}
View sample.php
<?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){
View db2.sql
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/
View .gitconfig
[difftool]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[merge]
tool = opendiff
View gist:1323310
<target name="phpdoc">
<exec executable="phpdoc">
<arg line="--directory ${basedir} --target ${basedir}/build/api --ignore ${basedir}/library/Zend/,${basedir}/library/MAL/" />
</exec>
</target>
View centos-add-epel.sh
[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 Aug 29, 2015
Neo4j relationships
View relations
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
View gist:d6aeb1eae81c65a78f59
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,
View zf-db-mock.php
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)
View better-example.php
<?php
interface iPropulsion
{
public function accelerate();
public function decelerate();
}
interface iOrdonance
{
You can’t perform that action at this time.