Skip to content

Instantly share code, notes, and snippets.

View ostretsov's full-sized avatar
🏠
Working from home

Artem Ostretsov ostretsov

🏠
Working from home
View GitHub Profile
@ostretsov
ostretsov / react_angular_1452442694.md
Created January 10, 2016 16:18
Repositories comparison: facebook/react, angular/angular.

Repositories comparison: facebook/react, angular/angular.

Generated by githubcmp-cli

Generation time: 01-10-2016 21:18

1. facebook/react with 76%

+--------------------------+-------+--------+----------+
<?php
/**
* (c) Artem Ostretsov <OstretsovAA@gmail.com>
*/
namespace ApiBundle\Tests;
use Liip\FunctionalTestBundle\Test\WebTestCase;
use AppBundle\Tests\TestHelper;
@ostretsov
ostretsov / git.cpp
Created June 8, 2015 03:01
Get system idle (tested in Ubuntu 14.04)
/* gcc -o git git.cpp -lX11 -lXss */
#include <X11/Xlib.h>
#include <X11/extensions/scrnsaver.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
Display *display = XOpenDisplay(NULL);
if (!display) {
return(1);
<?php
$varSession = new Zend_Session_Namespace('global');
$applicationIniFile = dirname(dirname(dirname(dirname(dirname(__FILE__))))) . '/application/configs/application.ini';
$configs = new Zend_Config_Ini($applicationIniFile, 'production');
?>
<script type="text/javascript">
function shuffle(array) {
if (array === undefined) {
return array;
}
package object test {
val a = 1
val b = 2
class C
trait D extends C
// write here anything you like
}
package test {
}
package test {
class Inner {
val pi = 3.1415
}
package innerTest {
private[test] class Inner2 {
val e = 2.7182
}
}
package test {
class Inner {
val pi = 3.1415
}
package innerTest {
class Inner2 {
val e = 2.7182
}
}
class BaseIntQueue {
private val buffer = new ArrayBuffer[Int]
def put(x: Int) = buffer += x
def get() = buffer.remove(0)
}
trait Double extends BaseIntQueue {
override def put(x: Int) = super.put(x * 2)
}
trait Point {
val x: Int = 5
val y: Int
}
class Something(override val x: Int = 6, val y: Int) extends Point
trait Point {
def x: Int
def y: Int
}
class Something(val x: Int, val y: Int) extends Point