Skip to content

Instantly share code, notes, and snippets.

Ján Koščo s7anley

  • Prague
Block or report user

Report or block s7anley

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
@s7anley
s7anley / commit-file.sh
Last active May 18, 2017
Amend of history commit for forgotten file.
View commit-file.sh
#!/usr/bin/env bash
$(git diff-index --quiet HEAD $1) > /dev/null
FILE_CHANGED=$?
if [ $FILE_CHANGED -eq 1 ];then
COMMIT=$(git log -n 1 --pretty=format:%H -- $1)
git add $1
git commit --fixup=$COMMIT
git rebase --interactive --autosquash $COMMIT^
fi
@s7anley
s7anley / test_setup_and_teardown.py
Last active Mar 28, 2017
Reusable setup and teardown for pytest
View test_setup_and_teardown.py
import pytest
def populate_tables(tables):
pass
def truncate_tables(tables):
pass
View keybase.md

Keybase proof

I hereby claim:

  • I am s7anley on github.
  • I am s7anley (https://keybase.io/s7anley) on keybase.
  • I have a public key ASC4tQjNQ_pwK0zrQJQbuvmOEoSTs20Qaoo3xNjkQIqoEgo

To claim this, I am signing this object:

View EvaluatorTest.php
<?php
/**
* @dataProvider expressionsProvider
*/
public function testEvaluateReceiveCorrectExpression(Expression $expectedExpression)
{
$evaluator = $this->getMock(Evaluator::class);
$evaluator->expects($this->once())
->method('evaluate')
@s7anley
s7anley / array_maps.go
Last active Feb 19, 2016
Introduction to Go
View array_maps.go
package main
import (
"fmt"
)
func main() {
var array [5]float64
array[0] = 98
@s7anley
s7anley / Zend_Auth_Adapter_BcryptDbTable.php
Created Nov 17, 2015
Zend_Auth_Adapter_BcryptDbTable
View Zend_Auth_Adapter_BcryptDbTable.php
<?php
class Base_Auth_Adapter_BcryptDbTable extends Zend_Auth_Adapter_DbTable
{
/**
* @inheritdoc
*/
protected function _authenticateCreateSelect()
{
$dbSelect = clone $this->getDbSelect();
View isUp.sh
#!/usr/bin/env bash
echo 'Enter host you want to ping:';
read PHOST;
if [[ "$PHOST" == "" ]]; then
exit;
fi
while true;
@s7anley
s7anley / Capfile
Created Oct 28, 2014
Easy local deployment of PHP applications with Capistrano 2
View Capfile
require 'railsless-deploy'
load 'path/to/script/deploy'
@s7anley
s7anley / pre-commit-php-cs-fixer.sh
Last active Aug 29, 2015
Pre commit php-cs-fixer
View pre-commit-php-cs-fixer.sh
#!/bin/bash
PROJECTROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/"
FIXER=php-cs-fixer.phar
if [ ! -e ${PROJECTROOT}${FIXER} ]; then
echo "PHP-CS-Fixer not available, downloading to ${PROJECTROOT}${FIXER}..."
curl -s http://cs.sensiolabs.org/get/$FIXER > ${PROJECTROOT}${FIXER}
echo ""
fi
@s7anley
s7anley / analytics.js
Created Apr 23, 2014
Tracking GA events before redirect.
View analytics.js
_gaq.push(
['_trackEvent', 'Category', 'Action', 'Label'],
function() {
window.location.href = '/';
}
);
You can’t perform that action at this time.