Skip to content

Instantly share code, notes, and snippets.

View tworzenieweb's full-sized avatar

Łukasz Adamczewski tworzenieweb

View GitHub Profile
#!/usr/bin/env sh
set -e
# Usage:
# export CI_API_TOKEN=<YOUR_TOKEN with api scope from https://gitlab.com/profile/personal_access_tokens>
# export CI_API_V4_URL=https://gitlab.com/api/v4
# export CI_PROJECT_ID=37
#
# ./deployment/bin/stop-all-dev-environments
@tworzenieweb
tworzenieweb / join.php
Last active March 9, 2018 11:08
Propel multiple conditions join
<?php
$query->addJoin(
[JobSponsoredPeer::ID, JobLocationPeer::JOB_TYPE],
[JobLocationPeer::JOB_ID, JobOffer::TYPE_SPONSORED],
Criteria::LEFT_JOIN
);
/**
* SELECT * FROM `job_sponsored`
<?xml version="1.0" encoding="UTF-8"?>
<channel name="xfce4-keyboard-shortcuts" version="1.0">
<property name="commands" type="empty">
<property name="default" type="empty">
<property name="&lt;Alt&gt;F1" type="empty"/>
<property name="&lt;Alt&gt;F2" type="empty">
<property name="startup-notify" type="empty"/>
</property>
<property name="&lt;Alt&gt;F3" type="empty">
@tworzenieweb
tworzenieweb / send.sh
Created May 16, 2017 08:58
Sending smtp email through bash
echo "justtesting" | mailx -s "Subject" -S smtp=smtp://outlook.office365.com -S smtp-use-starttls -S ssl-verify=ignore -S smtp-auth=login -S smtp-auth-user=<user>-S smtp-auth-password=<password> -S from="Sender <sender@email>" recipient@email
@tworzenieweb
tworzenieweb / mysql2sqlite.sh
Created April 4, 2017 10:33 — forked from esperlu/mysql2sqlite.sh
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
@tworzenieweb
tworzenieweb / clean.sh
Created February 14, 2017 21:21
Remove _test_ tables from mysql schemas
mysql -u root -se "SELECT CONCAT('DROP DATABASE ', SCHEMA_NAME, ';') FROM information_schema.SCHEMATA WHERE SCHEMA_NAME LIKE '%_test_%'"
@tworzenieweb
tworzenieweb / install.sh
Created July 26, 2016 06:28
install homebrew on Debina 8
curl -L -O https://github.com/phpbrew/phpbrew/raw/master/phpbrew
chmod +x phpbrew
sudo mv phpbrew /usr/bin/phpbrew
phpbrew
phpbrew init
nano ~/.zshrc
soure ~/.zshrc
phpbrew install 5.4.45
sudo apt-get install libxml2-dev
<?php
$installer = new Mage_Eav_Model_Entity_Setup('eav_setup');
$installer->startSetup();
$inheritBase = 9; // default for product
$attributeSetName = 'Custom Attribute Set';
$installer->addAttributeSet('catalog_product', $attributeSetName);
@tworzenieweb
tworzenieweb / ComponentExtension.php
Last active December 18, 2015 01:08
jquery hinclude like extension
<?php
namespace Phpme\Bundle\ExampleBundle\Twig\Extension;
use Symfony\Bundle\FrameworkBundle\HttpKernel;
class ComponentExtension extends \Twig_Extension
{
private $httpKernel;
<?php
namespace Luxodo\Bundle\ProductionBundle\Tests;
use Luxodo\Bundle\ProductionBundle\Entity\Product;
use Luxodo\Bundle\ProductionBundle\Manager\StatusManager;
class ProductTest extends \PHPUnit_Framework_TestCase
{