Skip to content

Instantly share code, notes, and snippets.

View Scarbous's full-sized avatar
🧐

Sascha Heilmeier Scarbous

🧐
  • netlogix GmbH & Co. KG
  • Germany
View GitHub Profile
@Scarbous
Scarbous / ucfirst.js
Created November 15, 2021 13:25
Add ucfirst to String
String.prototype.ucfirst = function() { return this.charAt(0).toUpperCase() + this.slice(1); }
@Scarbous
Scarbous / nginx.conf
Created November 8, 2021 07:28
Handle nginx njs Digest Auth
http {
resolver 8.8.8.8;
js_path "/etc/nginx/js/";
js_import server.js;
js_var $digest_header;
js_var $digest_path;
location ~ ^/api/getFoo/(\d*) {
limit_except GET { deny all; }
@Scarbous
Scarbous / commands.sh
Created December 5, 2019 08:28
Bash Commands
# get files bigger then 1G in current dir
find . -maxdepth 5 -type f -size +1G -print0 | xargs -0 ls -Shal
# get size of folders in current dir, sortet by size
du -h -d1 | sort -h
# delete files older then 7 days in current dir
find . -type f -mtime +7 -print | xargs rm
@Scarbous
Scarbous / jQuery.zoom.js
Created April 5, 2018 11:46
jQuery Zoom-Trigger
(function($, w, d) {
function scroll(e) {
if (!e.ctrlKey) return;
var oe = e.originalEvent,
t = oe.wheelDelta > 0 || oe.detail < 0 ? "In" : "Out";
if (t) trigger(t, e);
}
function keyDown(e) {
if (!e.ctrlKey) return;
@Scarbous
Scarbous / MyRepository.php
Last active December 22, 2022 14:33
TYPO3 extbase get SQL statement from query
<?php
class MyRepository extends Repository
{
function findSome() {
$query = $this->createQuery();
$query->matching(
// ...
);
$queryParser = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::class);
\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($queryParser->convertQueryToDoctrineQueryBuilder($query)->getSQL());

Keybase proof

I hereby claim:

  • I am scarbous on github.
  • I am scarbous (https://keybase.io/scarbous) on keybase.
  • I have a public key ASDLGg1TMoykloL8b1Rz_Zf1eMciDxDYNNEs51S30KixkQo

To claim this, I am signing this object:

@Scarbous
Scarbous / deploy_checkout_tag.php
Created September 15, 2017 13:14
deployer Task to checkout last tag
<?php
task('deploy:release:tag', function(){
$stage = input()->getArgument('stage');
# only in production stage
if (!in_array($stage,['production'])) {
return true;
}
$git = get('bin/git');
$repository = trim(get('repository'));