Skip to content

Instantly share code, notes, and snippets.

Avatar

Vranac Srdjan vranac

  • Novi Sad, Vojvodina, Serbia
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 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
{
View gist:0980427ec87538aae390
± 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!
View memtest-result
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
You can’t perform that action at this time.