Skip to content

Instantly share code, notes, and snippets.

View greg606's full-sized avatar
:octocat:
already replaced by AI

Greg Szczotka greg606

:octocat:
already replaced by AI
View GitHub Profile
/**
* Implements hook_theme().
*/
function support_theme($existing, $type, $theme, $path)
{
$commentField = $existing['comment'];
$commentField['template'] = 'comment--field-support';
$commentField['path'] = 'modules/custom/support/templates';
/**
* get total records
*
* @return integer
*/
public function getTotalRecords()
{
$qb = clone $this->queryBuilder;
$this->_addSearch($qb);
$qb->resetDQLPart('orderBy');
@greg606
greg606 / gist:8842027
Created February 6, 2014 10:50
Twig power
{% set position = attribute(match.homeFormation, "getPlayer" ~ loop.index ~ "Position")|split(',') %}
1) FlashcardsController GET index assigns all flashcards as @flashcards
Failure/Error: assigns(:flashcards).should eq([flashcard])
expected: [#<Flashcard id: 350, question: "MyText", answer: nil, created_at: "2013-09-16 07:27:38", updated_at: "2013-09-16 07:27:38">]
got: #<ActiveRecord::Relation [#<Flashcard id: 118, question: "MyText", answer: nil, created_at: "2013-09-16 06:55:02", updated_at: "2013-09-16 06:55:02">, #<Flashcard id: 119, question: "MyText", answer: nil, created_at: "2013-09-16 06:55:02", updated_at: "2013-09-16 06:55:02">, #<Flashcard id: 120, question: "MyText", answer: nil, created_at: "2013-09-16 06:55:02", updated_at: "2013-09-16 06:55:02">, #<Flashcard id: 121, question: "MyText", answer: nil, created_at: "2013-09-16 06:55:02", updated_at: "2013-09-16 06:55:02">, #<Flashcard id: 122, question: "MyText", answer: nil, created_at: "2013-09-16 06:55:02", updated_at: "2013-09-16 06:55:02">, #<Flashcard id: 123, question: "MyText", answer: nil, created_at: "2
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>
</title>
</head>
<body>
<a href="?akcja=sortuj">Sortuj</a>
/home/greg606/.rvm/rubies/ruby-2.0.0-p247/bin/ruby -S bundle exec cucumber --profile default
DEPRECATION WARNING: ActionController::Integration is deprecated and will be removed, use ActionDispatch::Integration instead. (called from require at /var/www/plerails/features/support/env.rb:7)
DEPRECATION WARNING: ActionController::IntegrationTest is deprecated and will be removed, use ActionDispatch::IntegrationTest instead. (called from require at /var/www/plerails/features/support/env.rb:7)
Using the default profile...
Feature: Add flashcard
In order to collect knowledge
As a learner
I want to be able to create a flashcard
Scenario: Add first flashcard # features/add_flashard.feature:6
@greg606
greg606 / gist:5944542
Last active May 10, 2017 17:37
ubuntu/mint install
sudo apt-get install apache2 php70 libapache2-mod-php phpmyadmin php7.1-curl php7.1-mcrypt
sudo apt-get install git mc vim subversion saidar htop curl mcrypt postfix whois guake software-properties-common python-software-properties python g++ make ant default-jdk
##phantomjs
sudo apt-get install build-essential g++ flex bison gperf ruby perl \
libsqlite3-dev libfontconfig1-dev libicu-dev libfreetype6 libssl-dev \
libpng-dev libjpeg-dev python libx11-dev libxext-dev ttf-mscorefonts-installer
## phpstorm
var localOptions = {
buttonText: {
today: 'Dzisiaj',
month: 'Miesiąc',
day: 'Dzień',
week: 'Tydzień'
},
monthNames: ['Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec','Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'],
monthNamesShort: ['Sty','Lut','Mar','Kwi','Maj','Cze','Lip','Sie','Wrz','Paź','Lis','Gru'],
dayNames: ['Niedziela','Poniedziałek','Wtorek','Środa','Czwartek','Piątek','Sobota'],
<?php
require_once dirname(__DIR__).'/../../../../app/AppKernel.php';
/**
* Test case class helpful with Entity tests requiring the database interaction.
* For regular entity tests it's better to extend standard \PHPUnit_Framework_TestCase instead.
*/
abstract class KernelAwareTest extends \PHPUnit_Framework_TestCase
{
@greg606
greg606 / gist:4002157
Created November 2, 2012 15:47
git colors
#Just add the following to ~/.gitconfig:
[color]
branch = auto
diff = auto
status = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green