Skip to content

Instantly share code, notes, and snippets.

View michabbb's full-sized avatar
💯
Need help ? Call me.....

Micha(el) Bladowski michabbb

💯
Need help ? Call me.....
View GitHub Profile
@michabbb
michabbb / mass_rename_file_extension_and_convert_it_to_utf8.sh
Created January 28, 2020 11:20
mass rename file extension and convert it to utf8
#!/bin/bash
find /yourpath/ -path /yourpath/vendor -prune -o -type f -name "*.inc" -print0 | while read -d $'\0' file
do
DIR=$(dirname "${file}")
filename=$(basename -- "$file")
filename_without_ext="${filename%.*}"
NEWFILENAME="$DIR"/"$filename_without_ext".php
echo "$NEWFILENAME"
git -C /yourpath/ mv "$file" "$NEWFILENAME"
done
@michabbb
michabbb / parse_ebay_itemid_from_url.js
Created July 9, 2019 17:32
Parse ebay itemid from url
parseUrlForEbayItemId(url) {
if (url) {
if (url.toLowerCase()
.indexOf('ebay') >= 0) {
console.log('ebay found');
// this url is on ebay, try to get the item id
const splited = url.split('/');
// search for "/itm/"
if (splited.indexOf('itm') > 0) {
console.log('itm found');
@michabbb
michabbb / angular_ebay_custom_shop_pages_example.html
Created July 9, 2019 16:53
load angular inside ebay custom shop pages
<link rel="stylesheet" href="https://mydomain.com/css/styles.css">
<script type="text/javascript">
var _runtimeES2015 = document.createElement('script');
_runtimeES2015.setAttribute('type', 'text/javascript');
document.getElementsByTagName('head')[0].appendChild(_runtimeES2015);
_runtimeES2015.setAttribute('src', 'https://mydomain.com/js/runtime-es2015.js');
var _polyES2015 = document.createElement('script');
_polyES2015.setAttribute('type', 'text/javascript');
@michabbb
michabbb / ebay-upload-images-parallel.php
Created May 27, 2019 14:44
Upload Images to Ebay in parallel
<?php
/**
the composer.json used here:
{
"require": {
"guzzlehttp/guzzle": "^6.3"
},
"require-dev": {
"kint-php/kint": "^3.2"
@michabbb
michabbb / ebay_oauth_refresh_token.php
Created May 23, 2019 10:46
Ebay oAuth Refresh Token
<?php
$request = new HttpRequest();
$request->setUrl('https://api.ebay.com/identity/v1/oauth2/token');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'Postman-Token' => '3bdefdd5-8df9-4fc1-a8b1-71f6143935cc',
'cache-control' => 'no-cache',
'Authorization' => 'Basic xxxxxxxxxxxx==',
@michabbb
michabbb / ebay_get_user_oauth_token.php
Created May 23, 2019 10:44
Ebay Oauth: Get User oAuth Token
<?php
$request = new HttpRequest();
$request->setUrl('https://api.ebay.com/identity/v1/oauth2/token');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'Postman-Token' => '5db47236-6d6b-48fe-b43f-912caa72a793',
'cache-control' => 'no-cache',
'Authorization' => 'Basic xxxxxxxxxxxx==',
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xmime="http://www.w3.org/2005/05/xmlmime"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:ns="urn:ebay:apis:eBLBaseComponents"
xmlns="urn:ebay:apis:eBLBaseComponents"
targetNamespace="urn:ebay:apis:eBLBaseComponents"
>
@michabbb
michabbb / entries.php
Created July 12, 2018 15:14
hacking cockpitcms default collections order view
<style>
.uk-scrollable-box {
border: none;
padding-top: 0;
padding-left: 0;
}
.collection-grid-avatar-container {
{
"11-05": {
"Day": "Friday",
"Pro": "Prügler",
"Con": "Glas",
"Element": "Solar"
},
"12-05": {
"Day": "Saturday",
"Pro": "Schwergewicht",
@michabbb
michabbb / import-aqbanking-account-balance.php
Created April 25, 2018 21:39
Import aqbanking balance files into db - because of this issue i created a php script to get the account balance in a different table - https://github.com/nafets227/finance/issues/1
<?php
/***
*
* --
-- Set character set the client will use to send SQL statements to the server
--
SET NAMES 'utf8';
--