Skip to content

Instantly share code, notes, and snippets.

View spinsch's full-sized avatar
🐱

Marc spinsch

🐱
  • HKW
  • Switzerland
  • 15:04 (UTC +02:00)
View GitHub Profile

Keybase proof

I hereby claim:

  • I am rcro on github.
  • I am rcro (https://keybase.io/rcro) on keybase.
  • I have a public key whose fingerprint is 1D47 F42B C687 6479 BC95 FD1F 9BC2 AE65 3AAE D6FC

To claim this, I am signing this object:

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC9icSa8jnZea1joCdi8M1SRLmHzRtG2YOPyAPZ7xW/rsjX/io29ict3uyTIK8ev7js5boiWUnbUHa3JX+ShGNfFS5WPg0/7g3s1p+BM4mPsvrJI/t3Y05a4tCpQuMphSMeqh05gEosh7zOfnf58Oa3KziRmMSahG4G2ziL92YtWk7GidCHrsybdhDdjBrrAnkz1Z9WfIYjZbOllM+EBQt9/e4CL+Knp8mGVcbGQu9Pw65RjKAUDtVKwvLr5YA9ByQu2r1nBlqbM1tU7B/M6JWUtWL4O9nkor+RYe0VMCIrAqw8iDqvpVVCs4HY2yL/mE5xFjoJQM13iiIDkxzpmGJJytJBjUulqSJYb/Ffp86l30/RWMNmCMkSadW9ZWD9Yf47nrwNrfbYGhvY/mD3AMaLMYMpJPTjaRw4RlWVMNUl4XeGJPS9I8PfBCwA+L6kKDFRPsrKURGtvUZy/7v+Z6BDxWchSQ2Ynz0es9Ppha/oEv8OkCaV76GW6V+t89K/tq1nn0s+IR0XerHe7xu2l2Mkrzp1nMuBegPSPyH75dQ3J33E26Y1YDDyPM0v6T6kJeSWCEoxmNTzeUUaqMS2C5ZbgQmC6+fiu+riBiruG6JuPRkH9qtABvbUHUThXI9b34N0S8Rxh7/Opw9kVYI06oRd2f92MPw9qSHKs+eGAEHgsw== romano.marc@gmail.com
@spinsch
spinsch / Magento1ValetDriver.php
Last active October 29, 2019 11:43
Laravel Valet Driver for Magento 1
<?php
/*
* Magento 1 Valet Driver
* @author spinsch
* @path ~/.valet/Drivers/Magento1ValetDriver.php
*/
class Magento1ValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
@spinsch
spinsch / convert.php
Last active December 13, 2017 17:27
convert magento translation-file to apple-ios string-file to use the google translation toolkit
<?php
/**
* convert magento translation file to ios STRING file
* to use the google translation toolkit
*
* usage: php convert.php translation.csv > translation.STRINGS
* php convert.php translation.STRINGS > translation.csv
*
* @author rcro <romano.marc@gmail.com>
*/
@spinsch
spinsch / fileupload_debug.php
Created August 15, 2017 14:57
image upload test for php via post
<?php
function return_bytes($val) {
$val = trim($val);
$last = strtolower($val[strlen($val)-1]);
switch($last) {
// The 'G' modifier is available since PHP 5.1.0
case 'g':
$val *= 1024;
case 'm':
@spinsch
spinsch / netflix.txt
Created October 21, 2017 13:08
Netlix Genre List and Codes
https://www.netflix.com/browse/genre/<GENRE-CODE>/
Action & Adventure (1365)
Asian Action Movies (77232)
Classic Action & Adventure (46576)
Action Comedies (43040)
Action Thrillers (43048)
Adventures (7442)
Comic Book and Superhero Movies (10118)
Westerns (7700)
@spinsch
spinsch / tld.php
Created November 22, 2017 14:35
create a tld list for copy&paste as php array
<?php
header("Content-type: text/plain");
echo "array(\n";
foreach (new NoRewindIterator(new SplFileObject('https://data.iana.org/TLD/tlds-alpha-by-domain.txt')) as $i => $v) {
if ($i == 0) {continue;};
echo "\040\040\040\040'".idn_to_utf8(trim(strtolower($v)))."',\n";
}
echo ");";
@spinsch
spinsch / debug.php
Created October 5, 2018 14:15
Create Test-Order on Magento 1.9.3.x with SOAP Api V2
<?php
// debug script
// apiDoc: https://devdocs.magento.com/guides/m1x/api/soap/checkout/checkout.html
$proxy = new SoapClient('http://lts.localhost/api/v2_soap/?wsdl');
$sessionId = $proxy->login('debug', 'debug123');
// create cart
@spinsch
spinsch / clean-up-boot-partition-ubuntu.md
Created January 4, 2019 14:54 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@spinsch
spinsch / example.php
Last active January 24, 2019 16:02
get last 20 elements from sitemap.xml with php
<?php
// this is for schema http://www.sitemaps.org/schemas/sitemap/0.9
// config
$lastNElements = 20;
// url or filepath
//$source = 'https://www.digitec.ch/sitemap0.xml';