Skip to content

Instantly share code, notes, and snippets.

View dbaltas's full-sized avatar

Dimitris Baltas dbaltas

View GitHub Profile
@dbaltas
dbaltas / dotnet-core-sln-scaffolding-and-run
Created May 6, 2020 12:23
Cli commands to create a hello world solution with one console project and one test project, that also runs the app and tests. Works for osx!
mkdir HelloWorld
cd HelloWorld
dotnet new sln --name HelloWorld
dotnet new console --name HelloWorld
dotnet new nunit --name HelloWorld.UnitTests
dotnet sln add HelloWorld/HelloWorld.csproj
dotnet sln add HelloWorld.UnitTests/HelloWorld.UnitTests.csproj
dotnet build
dotnet test
dotnet run --project HelloWorld
<?php
function foo() : void
{
// there is a trailing space in this comment!
$var1 = (
$var2 ?? 0);
}
@dbaltas
dbaltas / sublime-tips-to-improve-productivity.md
Last active February 6, 2018 09:56
Sublime tips to improve productivity

Intro

Sublime is a powerful editor that in many cases can be better, and much faster to write code than a powerful IDE.

The shortcuts below are for macOS.

Navigation

Previous/Next Cursor position

To navigate to the previous cursor position ctrl+-. To go to the next cursor position ctrl++

This works across open files

Previous/Next word occurence

Having the cursor in the word you want to find, use two features combined "Expand Selection to word" and "Find"

@dbaltas
dbaltas / entries-dummy.json
Created December 19, 2015 17:18
js/app/data/entries.json for greek-in-tech
This file has been truncated, but you can view the full file.
[
{
"id" : 1,
"title": "Cron (job scheduler)",
"description": "It comes from the Greek word for time, chronos (χρόνος). Chronos is the personification of time in early Greek mythology and literature. He later appears in the Renaissance as Father Time.",
"viewed" : false,
"categories": [
"OS",
"unix",
"linux",
@dbaltas
dbaltas / tidy_xml_lint.py
Created July 22, 2013 14:15
Sublime Text 3 plugin for formatting xml. Works on Sublime Text 2 as well. Created by André Bergonse http://www.bergspot.com/blog/2012/05/formatting-xml-in-sublime-text-2-xmllint/
import sublime, sublime_plugin, subprocess
class TidyXmlLintCommand(sublime_plugin.TextCommand):
def run(self, edit):
command = "XMLLINT_INDENT='\t' xmllint --format --encode utf-8 -"
# help from http://www.sublimetext.com/forum/viewtopic.php?f=2&p=12451
xmlRegion = sublime.Region(0, self.view.size())
p = subprocess.Popen(command, bufsize=-1, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE, shell=True)
result, err = p.communicate(self.view.substr(self.view.sel()[0]).encode('utf-8'))
@dbaltas
dbaltas / random-thoughts-on-paratest-architecture.md
Created June 30, 2013 23:53
Identify the Major Components of brianium/paratest

The objective of ParaTest is to support parallel testing in a variety of PHP testing tools.

We can split paratest tasks

  1. Identify the ExecutableTests to be run
  2. Run
  3. Collect output, parse and summarize

The List of Executable Tests

Identify the test suites that need to be executed

@dbaltas
dbaltas / review-handon-testing-with-phpunit-howto.md
Last active December 18, 2015 11:28
Review on Hands­on Testing with PHPUnit How­to

PHPUnit is a testing framework that is supported, integrated and suggested by the majority of PHP frameworks.Test Driven Development (TDD), and Continuous Integration are here to stay and PHPUnit is an industry standard that caters for both.

The book [‘Hands­on Testing with PHPUnit How­to’][1] offers a quick but thorough step by step guide over the core concepts of PHPUnit. In a ‘learn by example’ approach the programmer gets acquainted with the TDD process without feeling overwhelmed with pompous definitions.

@dbaltas
dbaltas / composer-install
Created January 31, 2013 17:22
Script to install composer
cd /usr/local/bin/ &&
curl -s https://getcomposer.org/installer | sudo php &&
sudo chmod a+x composer.phar &&
sudo mv composer.phar composer
@dbaltas
dbaltas / gist:4672866
Last active February 8, 2019 01:16
Running Paratest on different database instances
Hi Brian, @brianium
Congratulations on Paratest.
It is a very well written project.
We (as tripsta organization) want to run our test suite in parallel.
Our application is on Zend Framework 1.12, php 5.4, phpunit 3.5.15 and mysql 5.5.
Our test suite has 13000 unit tests and is taking around 22 minutes to run on our testing environment.
Most of the tests have (unfortunately) heavy database access.
@dbaltas
dbaltas / application-ini-centurion-in-existing-zf-application
Created September 20, 2012 09:00
application.ini updates for Centurion integration in existing Zend Framework Application
+autoloadernamespaces.3 = "Centurion_"
+resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
+resources.frontController.params.displayExceptions = 0
+phpSettings.display_startup_errors = 0
+phpSettings.display_errors = 0
+
+zfdebug = false
+
+centurion.auth_profile = "User_Model_DbTable_Profile"