Skip to content

Instantly share code, notes, and snippets.

View leonlaser's full-sized avatar
🍪

Leon Dietsch leonlaser

🍪
View GitHub Profile
@anvk
anvk / psql_useful_stat_queries.sql
Last active July 12, 2024 11:28
List of some useful Stat Queries for PSQL
--- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md
--- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192
-- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB.
------------
-- Basics --
------------
-- Get indexes of tables
@htuscher
htuscher / .gitlab-ci.yml
Created August 3, 2017 08:12
Deploying with docker-compose via SSH tunnel in Gitlab CI
deploy:live:
image: 1drop/docker:git
stage: deploy
when: manual
environment:
name: production
url: https://www.somecustomer.de
before_script:
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
#!/bin/bash
# restore with the following command:
# gunzip --stdout <filename>.img.gz | dd bs=10M of=/dev/sdX
# pv(1) is optional and provides a progress bar
# just remove it from the pipe, when you don't want it
DATE=$(date +"%Y-%m-%d_%H-%M")
GREEN='\033[1;32m'
@scotthaleen
scotthaleen / smallest_jpg_bytes.txt
Last active June 10, 2024 15:00
Smallest Valid JPG
# http://web.archive.org/web/20111224041840/http://www.techsupportteam.org/forum/digital-imaging-photography/1892-worlds-smallest-valid-jpeg.html
FF D8 FF E0 00 10 4A 46 49 46 00 01 01 01 00 48 00 48 00 00 FF DB 00 43 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF C2 00 0B 08 00 01 00 01 01 01 11 00 FF C4 00 14 10 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF DA 00 08 01 01 00 01 3F 10
# Base64 Encoded
/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAP//////////////////////////////////////////////////////////////////////////////////////wgALCAABAAEBAREA/8QAFBABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQABPxA=
@smichaelsen
smichaelsen / gitlab_typo3_setup.md
Last active August 12, 2022 14:11
Setting up a Build Server for TYPO3 projects on Gitlab.com

Setting up a Build Server for TYPO3 projects on Gitlab.com

Background

We're a small team of only two people, but we're tackling more and more rather big TYPO3 projects. Over time we introduced package management for PHP (composer) and JS (bower) and depended on frontend building with Grunt. With rising complexity and importance of our projects we felt the demand for an efficient and safe way to deploy our websites on different servers.

We helped our selves with small self written deploy scripts that performed building on the target server, but you can't run node (for Grunt) or sass in every environment, and if building goes wrong the website was likely to be broken on the live server - so we needed a Build Server.

But solutions we looked at turned out to be quite time consuming (setting up and managing self hosted Gitlab and Gitlab-CI or a Jenkins server and runners) or costly.

Free Hosting on Gitlab.com

@Rpsl
Rpsl / terminal.sh
Last active October 10, 2017 09:58
Open iTerm (2.9+) terminal from PhpStorm/WebStorm/Idea ( NativeNeighbourhood plugin ); Raw
cd ~/Library/Application\ Support/WebIde100/NativeNeighbourhood/classes/org/intellij/plugins/nativeNeighbourhood/icons/macosx
echo '#!/bin/sh
#
# !!!This is only for iTerm 2.9 and above!!!
#
# Reveal a directory in the Terminal.
#
# The script takes one argument, the qualified name of a directory.
#
@uberboom
uberboom / PageLayoutView.php
Last active January 30, 2020 19:17
TYPO3: Render a backend preview of custom content elements (TYPO3 CMS 6.2)
<?php
namespace Your\Extension\Namespace\Hooks;
class PageLayoutView implements \TYPO3\CMS\Backend\View\PageLayoutViewDrawItemHookInterface
{
/**
* Preprocesses the preview rendering of a content element.
*
@xdamman
xdamman / install_ffmpeg_ubuntu.sh
Created July 2, 2014 21:03
Install latest ffmpeg on ubuntu 12.04 or 14.04
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from https://gist.github.com/faleev/3435377
# Remove any existing packages:
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev
# Get the dependencies (Ubuntu Server or headless users):
sudo apt-get update
@brenopolanski
brenopolanski / merge-pdf-ghostscript.md
Last active July 5, 2024 18:44
Merge multiple PDFs using Ghostscript

A simple Ghostscript command to merge two PDFs in a single file is shown below:

gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=combine.pdf -dBATCH 1.pdf 2.pdf

Install Ghostscript:

Type the command sudo apt-get install ghostscript to download and install the ghostscript package and all of the packages it depends on.

# sleepy flower girl
(◡ ‿ ◡ ✿)
# y u no
ლ(ಠ益ಠლ)
# smiling breasts
(^人^)
# flipping tables