Skip to content

Instantly share code, notes, and snippets.

View kpodemski's full-sized avatar
🏠
Working from home

Krystian Podemski kpodemski

🏠
Working from home
View GitHub Profile
#!/bin/bash
FILES_TO_COMMIT=`git status -s | cut -c4-`
if [[ ! -z $FILES_TO_COMMIT ]]; then
for file in $FILES_TO_COMMIT; do
if [[ "$file" == *.php ]]; then
./vendor/bin/php-cs-fixer fix "$file"
fi
done
@firstred
firstred / setup github issues labels.sh
Last active August 5, 2016 11:37 — forked from rentzsch/setup github issues labels.sh
Shell script to set up a GitHub Project's Issues' Labels as described in <http://rentzsch.tumblr.com/post/252878320/my-lighthouse-ticket-settings-with-colors>.WARNING: script assumes a newish project that hasn't really used labels yet. It deletes all default labels, which means DATA LOSS if you've used them for anything.
USER=firstred
PASS=mypassword
REPO=myrepo
# Delete default labels
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$USER/$REPO/labels/bug"
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$USER/$REPO/labels/duplicate"
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$USER/$REPO/labels/enhancement"
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$USER/$REPO/labels/invalid"
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$USER/$REPO/labels/question"
@ocombe
ocombe / translateUniversalLoader.ts
Last active May 11, 2023 07:01
ng2-translate file loader for Angular Universal (server side)
import {TranslateLoader} from "ng2-translate/ng2-translate";
import {Observable} from "rxjs/Observable";
import fs = require('fs');
export class TranslateUniversalLoader implements TranslateLoader {
constructor(private prefix: string = 'i18n', private suffix: string = '.json') {}
/**
* Gets the translations from the server
* @param lang
@twesolowski
twesolowski / parse.php
Last active March 1, 2018 12:22
Prestashop country translation importer
<?php
/*
* example usage: php parse.php --file="de\data\country.xml" --lang=de --prefix=ps_
* generates imports country translations in DE lang
*/
$options = getopt(null, array(
"file:", // Required
"prefix::", // Optional
"lang::" // Required
@hereswhatidid
hereswhatidid / Media.php
Last active December 11, 2019 08:50
PrestaShop Media class override to allow for forcing some inline JavaScripts to remain inline.
<?php
Class Media extends MediaCore
{
public static function deferScript($matches)
{
if (!is_array($matches))
return false;
$inline = '';
if (isset($matches[0]))
@hakre
hakre / README.md
Last active August 7, 2024 13:23
Iterators for PHP XMLReader for ease of parsing

Iterators for PHP XMLReader for Ease of Parsing

Change Log:

  • 0.1.12 maintenance release with fixes.

  • 0.1.11 maintenance release with fixes. added XMLReader::CDATA and XMLReader::WHITESPACE node support for XMLWritingIteration. added