Skip to content

Instantly share code, notes, and snippets.

View cursedcoder's full-sized avatar
🐜
Working from nest

Yevhenii Huselietov cursedcoder

🐜
Working from nest
View GitHub Profile
@cursedcoder
cursedcoder / test.py
Created January 30, 2014 15:56
Memory leak PyQT5
from PyQt5.QtCore import QUrl
from PyQt5.QtWidgets import QApplication
from PyQt5.QtWebKitWidgets import QWebView
from PyQt5.QtWebKit import QWebSettings
class Crawler(QWebView):
def __init__(self):
QWebView.__init__(self)
self.settings().setMaximumPagesInCache(0)
cursedcoder@localhost ~/Projects/socks ±master[√] » php examples/server.php &
[1] 51255
SOCKS server listening on localhost:9050
cursedcoder@localhost ~/Projects/socks ±master[√] » php examples/server-middleman.php &
[2] 51290
SOCKS server listening on localhost:9051 (which forwards everything to SOCKS server 127.0.0.1:9050)
cursedcoder@localhost ~/Projects/socks ±master[√] » php examples/client.php
Demo SOCKS client connecting to SOCKS server 127.0.0.1:9051
cursedcoder@macohost ~/vendor/react ±master[∆] » cloc react/src
84 text files.
84 unique files.
20 files ignored.
http://cloc.sourceforge.net v 1.60 T=0.34 s (189.3 files/s, 14875.2 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
PHP 64 965 595 3470
server {
listen 80;
server_name poli.gon;
root /usr/local/www/poli.gon/web;
index app_dev.php index.html index.htm;
try_files $uri $uri/ @rewrite;
<?php
namespace MAD\FileManagerBundle\Core;
class Item {
public function delete() {
}
<?php
namespace MAD\FileManagerBundle\Core;
class Item {
private $path;
private $name;
public function testExample()
{
$fixture = json_encode(array(
'one' => array('id_str' => 1, 'text' => 'asdasdasd'),
'two' => array('id_str' => 2, 'text' => 'asdasdasd2'),
'three' => array('id_str' => 3, 'text' => 'asdasdasd3')
));
$mockedBrowser = $this->getMock(
'Buzz\Browser',
<?php
namespace Knp\Bundle\LastTweetsBundle\Tests\Twitter\LastTweetsFetcher;
use Knp\Bundle\LastTweetsBundle\Twitter\LastTweetsFetcher\ApiFetcher;
use Knp\Bundle\LastTweetsBundle\Twitter\Tweet;
class ApiFetcherTest extends \PHPUnit_Framework_TestCase
{
const CLASSNAME = 'Knp\Bundle\LastTweetsBundle\Twitter\LastTweetsFetcher\ApiFetcher';
<?php
namespace Knp\Bundle\LastTweetsBundle\Tests\Twitter\LastTweetsFetcher;
use Knp\Bundle\LastTweetsBundle\Twitter\LastTweetsFetcher\ApiFetcher;
use Knp\Bundle\LastTweetsBundle\Twitter\Tweet;
class ApiFetcherTest extends \PHPUnit_Framework_TestCase
{
const CLASSNAME = 'Knp\Bundle\LastTweetsBundle\Twitter\LastTweetsFetcher\ApiFetcher';
<?php
if (
!$this->isOauthExists()
&& ('oauth' === $driver
|| (isset($fetcherConfig['options']['method']) && 'oauth' === $fetcherConfig['options']['method']))
) {
throw new \InvalidArgumentException('You should install and enable InoriTwitterBundle');
}