Skip to content

Instantly share code, notes, and snippets.

View marcus-at-localhost's full-sized avatar
💭
☕

Marcus marcus-at-localhost

💭
☕
View GitHub Profile
@marcus-at-localhost
marcus-at-localhost / languagefilter.php
Created March 18, 2014 19:30
Joomla Language 303 redirect to better 301 redirect (/plugins/system/languagefilter/languagefilter.php)
// redirect if sef does not exists
// around line 226
if (!isset(self::$sefs[$sef]))
{
// Use the current language sef or the default one
$sef = isset(self::$lang_codes[$lang_code]) ? self::$lang_codes[$lang_code]->sef : self::$default_sef;
$uri->setPath($sef . '/' . $path);
if ($app->getCfg('sef_rewrite')) {
// append true for 301 redirect
@marcus-at-localhost
marcus-at-localhost / EasyWsdl2PHP.php
Created March 29, 2014 20:57
*EASY WSDL2PHP* generates the objects and function calls from your WSDL https://sourceforge.net/projects/easywsdl2php/
<?php
class EasyWsdl2PHP
{
static public function generate($url,$sname)
{
$soapClient = new SoapClient($url);
$classesArr = array();
$functions = $soapClient->__getFunctions();
@marcus-at-localhost
marcus-at-localhost / col.html
Last active August 29, 2015 13:58
Bootstrap flexbox widgets via http://www.bootply.com/126437 by @carolskelly
<div class="container"><h3>.row-flex (make columns equal heights in each row)</h3></div>
<div class="container">
<div class="row row-flex row-flex-wrap">
<div class="col-md-3">
<div class="panel panel-default flex-col">
<div class="panel-heading">Title flex-col</div>
<div class="panel-body flex-grow">Content here -- div with .flex-grow</div>
<div class="panel-footer">Footer</div>
</div>
</div>
@marcus-at-localhost
marcus-at-localhost / css_select_by_position.js
Created February 3, 2015 20:55
jquery select by position
// http://stackoverflow.com/a/9769532/814031
$('*').filter(function(){
var position = $(this).css('position');
return position === 'absolute';
});
// or extend jquery selector engine
// http://stackoverflow.com/a/9770766/814031
$.extend($.expr[':'],{
absolute: function(el) {
@marcus-at-localhost
marcus-at-localhost / Partial-string-replacement.php
Last active August 29, 2015 14:21
Partial string replacement to anonymize credit card numbers, bank account numbers etc
/**
* Replace middle of the string with given char, keeping length
* http://mamchenkov.net/wordpress/2011/05/17/partial-string-replacement-with-fixed-length-in-php/
*
* <code>
* print padString('1234567890123456', 1, 4, 'x');
* </code>
*
* @param string $string String to process
* @param integer $start Characters to skip from start
@marcus-at-localhost
marcus-at-localhost / zurb-ink-650.css
Last active August 29, 2015 14:27 — forked from rx/zurb-ink-650.css
Zurb Ink converted to 650px wide.
/**********************************************
* Ink v1.0.5 - Copyright 2013 ZURB Inc *
**********************************************/
/* Client-specific Styles & Reset */
#outlook a {
padding: 0;
}
@marcus-at-localhost
marcus-at-localhost / A-button.jade
Last active August 29, 2015 14:27
Jade/HTML Beispiel
table.button
tr
td(mc:edit="btn_call_to_action2")
a(href='#') Call To Action Button 2
@marcus-at-localhost
marcus-at-localhost / 1. Directory Structure.txt
Last active August 29, 2015 14:27
Jade Zurb Mailchimp Messup
.
| gruntfile.js
| package.json
|
+---dist
| | email-template-inline.html (inlined styles)
| | email-template.html (normal html)
| |
| +---css
| | mailchimp.css (just a copy)
@marcus-at-localhost
marcus-at-localhost / a_info.md
Last active August 29, 2015 14:27
Experimental Standalone OpenSSL text file de/encrypter for Sublime-Text-Crypto Package

OpenSSL text file de/encrypter

This is an alternative way to decrypt text files that got encrypted by the Sublime Text Crypto Package. Just in case, Sublime Text is not available.

Setup

  1. Download OpenSSL Windows Binaries here or here
  2. Extract to a folder openssl
  3. Place the file crypt.bat one level up
@marcus-at-localhost
marcus-at-localhost / ssh.md
Last active September 3, 2015 16:15
SSH in Windows
  1. puttygen.exe erzeugt privaten und öffentlichen Key.
  2. Speichere privaten Key mit Passwort als *.ppk
  3. Exportiere privaten Key als Open SSH Datei, um von Git & Co verwendet werden zu können.
  4. Lade die *.ppk Datei in pageant.exe dem Auth Agenten/Schlüsselmanager (Muss bei jedem Systemneustart erneut gemacht werden)
  5. Der öffentliche Schlüssel ssh-rsa AAAA...base64== rsa-key-20150903 wird auf dem Server in die Datei /.ssh/authorized_keys kopiert (musste vom Provider hinzugefügt werden)
  6. Test mit putty.exe ob man sich ohne Passwort per ssh einloggen kann.
  7. Kopiere die den privaten Key (openssh Datei) in das Verzeichnis C:\Users\xo\.ssh\ und nenne die Datei id_rsa -> Info
  8. Setze die Umgebungsvariablen GIT_SSH=E:\xampp\Putty\plink.exe und PATH=E:\xampp\Putty\ Info
  9. Starte Console2 oder CMD und verbinde dich mit dem Server ssh web@host.de -p 22
    Es wird nach dem Passwort der *.ppk