Skip to content

Instantly share code, notes, and snippets.

View dbalabka's full-sized avatar
🔍
Search for opportunities

Dmitry Balabka dbalabka

🔍
Search for opportunities
View GitHub Profile
@dbalabka
dbalabka / gist:5804104
Created June 18, 2013 09:51
Can't get all cookies with Selenium version 2.33.0
12:37:44.674 INFO - Executing: [get all cookies] at URL: /session/f1f0a5ca-b66c-43af-aa87-509f9aa34bd9/cookie)
12:37:44.691 WARN - Exception thrown
java.lang.IllegalArgumentException: Required attributes are not set or any non-null attribute set to null
at org.openqa.selenium.Cookie.validate(Cookie.java:140)
at org.openqa.selenium.Cookie.<init>(Cookie.java:86)
at org.openqa.selenium.Cookie$Builder.build(Cookie.java:225)
at org.openqa.selenium.remote.RemoteWebDriver$RemoteWebDriverOptions.getCookies(RemoteWebDriver.java:665)
at org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringOptions.getCookies(EventFiringWebDriver.java:510)
at org.openqa.selenium.remote.server.handler.GetAllCookies.call(GetAllCookies.java:33)
at org.openqa.selenium.remote.server.handler.GetAllCookies.call(GetAllCookies.java:1)
@dbalabka
dbalabka / .phpdebug
Last active January 11, 2019 09:47
!!! Script is migrated to https://github.com/torinaki/phpdebug-cli !!! XDebug PHP CLI debugging helper console commands with PhpStorm, NetBeans support.
# Installation steps:
# 1. Put this file under ~/.phpdebug
# $ curl https://gist.githubusercontent.com/torinaki/9059015/raw/.phpdebug > ~/.phpdebug
# 2. Put following lines into ~/.bashrc:
# # Get the aliases and functions
# if [ -f ~/.phpdebug ]; then
# . ~/.phpdebug
# fi
# 3. (optional) Script will try to autodetect your machine IP where runs IDE or use 127.0.0.1 otherwise.
# If automatic detection doesn't work for you, set ip directly via IDE_IP enviroment variable:
@dbalabka
dbalabka / gist:9807711
Created March 27, 2014 13:37
Build log of Octave using brew(without options)
This file has been truncated, but you can view the full file.
Dmitrijss-MacBook-Pro:Downloads torinaki$ brew install https://raw.github.com/mcg1969/homebrew-science/6023c75fe2c15f1ff1d15c74d873b177002cf8dc/octave.rb -v
/usr/bin/curl -fLA Homebrew 0.9.5 (Ruby 1.8.7-358; Mac OS X 10.9.2) https://raw.github.com/mcg1969/homebrew-science/6023c75fe2c15f1ff1d15c74d873b177002cf8dc/octave.rb -o /Library/Caches/Homebrew/Formula/octave.rb
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 7411 100 7411 0 0 17656 0 --:--:-- --:--:-- --:--:-- 17645
==> Using Homebrew-provided fortran compiler.
This may be changed by setting the FC environment variable.
==> Building with an alternative Fortran compiler
This is unsupported.
==> Building with an alternative Fortran compiler
@dbalabka
dbalabka / gist:9808055
Created March 27, 2014 13:53
Build log of Octave using brew(--without-check)
This file has been truncated, but you can view the full file.
Dmitrijss-MacBook-Pro:Downloads torinaki$ brew install https://raw.github.com/mcg1969/homebrew-science/6023c75fe2c15f1ff1d15c74d873b177002cf8dc/octave.rb -v --without-check
/usr/bin/curl -fLA Homebrew 0.9.5 (Ruby 1.8.7-358; Mac OS X 10.9.2) https://raw.github.com/mcg1969/homebrew-science/6023c75fe2c15f1ff1d15c74d873b177002cf8dc/octave.rb -o /Library/Caches/Homebrew/Formula/octave.rb
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 7411 100 7411 0 0 9396 0 --:--:-- --:--:-- --:--:-- 9392
==> Using Homebrew-provided fortran compiler.
This may be changed by setting the FC environment variable.
==> Building with an alternative Fortran compiler
This is unsupported.
==> Building with an alternative Fortran compiler
@dbalabka
dbalabka / stack_trace
Created May 14, 2014 14:51
PhantomJS crashes after multiple page load / async script calls #328
Operating system: Linux
0.0.0 Linux 2.6.32-358.11.1.el6.x86_64 #1 SMP Wed Jun 12 03:34:52 UTC 2013 x86_64
CPU: amd64
family 6 model 37 stepping 1
8 CPUs
Crash reason: SIGSEGV
Crash address: 0x39
Thread 0 (crashed)
@dbalabka
dbalabka / Vagrantfile
Created December 12, 2014 17:12
Vagrant VM with PHP, HHVM and ElasticSearch
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
$build_script = <<SCRIPT
apt-get update
echo Installing HHVM...
@dbalabka
dbalabka / .bashrc
Created February 3, 2015 14:41
GIT advanced support for command promt
# Append to ~/.bashrc
# Download from https://github.com/git/git/blob/master/contrib/completion/git-completion.bash
source ~/.git-completion.bash
# Download from https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh
source ~/.git-prompt.sh
# Below script is part of http://msysgit.github.io/
# non-printable characters must be enclosed inside \[ and \]
<?php
/**
* This file is part of PDepend.
*
* PHP Version 5
*
* Copyright (c) 2008-2013, Manuel Pichler <mapi@pdepend.org>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@dbalabka
dbalabka / ghost-upgrade.sh
Created July 16, 2015 08:51
Ghost blog upgrade with full backup
#!/bin/sh
cd /var/www &&
service ghost stop &&
now=$(date +"%Y%m%d_%H%M%S") &&
tar -zcvf "ghost_${now}.tar.gz" ./ghost &&
wget http://ghost.org/zip/ghost-latest.zip -O ghost-latest.zip &&
rm -rf ghost/core &&
unzip -uo ghost-latest.zip -d ghost &&
chown -R ghost:ghost ghost/* &&
cd ghost &&
@dbalabka
dbalabka / api.js
Last active August 18, 2016 23:35
Google Experiment Client
(function () {
var d, f = this, k = function (a, c, b) {
a = a.split(".");
b = b || f;
a[0] in b || !b.execScript || b.execScript("var " + a[0]);
for (var e; a.length && (e = a.shift());)a.length || void 0 === c ? b = b[e] ? b[e] : b[e] = {} : b[e] = c
}, l = Date.now || function () {
return +new Date
};
var p = function (a) {