Skip to content

Instantly share code, notes, and snippets.

View leonlaser's full-sized avatar
🍪

Leon Dietsch leonlaser

🍪
View GitHub Profile
@gre
gre / easing.js
Last active June 27, 2024 15:37
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
@mayconbordin
mayconbordin / progress_bar.php
Created June 2, 2012 23:55
PHP CLI progress bar in 5 lines of code
<?php
function progress_bar($done, $total, $info="", $width=50) {
$perc = round(($done * 100) / $total);
$bar = round(($width * $perc) / 100);
return sprintf("%s%%[%s>%s]%s\r", $perc, str_repeat("=", $bar), str_repeat(" ", $width-$bar), $info);
}
@jasperf
jasperf / lookforbadguys.php
Created July 28, 2012 00:47
Look for Bad Guys By Karen Chun, Steven Whitney #security #php
<?php
/* lookforbadguys.php 2011-09-27
Copyright (C)2011 Karen Chun, Steven Whitney.
Initially published by http://25yearsofprogramming.com.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License (GPL)
Version 3 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@natelandau
natelandau / .bash_profile
Last active June 13, 2024 18:01
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
# sleepy flower girl
(◡ ‿ ◡ ✿)
# y u no
ლ(ಠ益ಠლ)
# smiling breasts
(^人^)
# flipping tables
@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.

@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
@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.
*
@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.
#
@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