Skip to content

Instantly share code, notes, and snippets.

View renepardon's full-sized avatar

Christoph, René Pardon renepardon

View GitHub Profile
@moro
moro / nginx-local.conf
Created January 30, 2012 03:02
nginx configuration for local development w/ http://foo.dev:10080
# vim:set ft=nginx:
worker_processes 2;
pid /Users/moro/.nginx/nginx.pid;
error_log /Users/moro/.nginx/error.log;
events {
worker_connections 1024;
}
http {
@piotrplenik
piotrplenik / ssh_key_validation.php
Created August 3, 2012 14:25
SSH-RSA/SSH-DSA validation
<?php
public function validateKey($value)
{
$key_parts = explode(' ', $value, 3);
if (count($key_parts) < 2) {
return false;
}
@vvo
vvo / video-snapshots-sprites.sh
Created July 15, 2013 14:28
generate sprites of video snapshots
sudo aptitude install ffmpeg
sudo aptitude install imagemagick
# fps=1 > every seconds
ffmpeg -i video.mp4 -f image2 -vf fps=fps=1 out%d.png
# horizontal sprite, resized at 30%
convert -resize 30% +append out*.png sprite-1-sec.png
# references:
@ralavay
ralavay / vim-nginx-conf-highlight.sh
Last active April 21, 2024 03:58
Enable syntax highlight for Nginx conf file in Vim
#!/bin/bash
#
# Highligh Nginx config file in Vim
# Download syntax highlight
mkdir -p ~/.vim/syntax/
wget http://www.vim.org/scripts/download_script.php?src_id=19394 -O ~/.vim/syntax/nginx.vim
# Set location of Nginx config file
cat > ~/.vim/filetype.vim <<EOF
@renshuki
renshuki / ubuntu_agnoster_install.md
Last active April 23, 2024 13:04
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH

@rvl
rvl / git-pushing-multiple.rst
Created February 9, 2016 11:41
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@tjdaley
tjdaley / dot-notation-setter-getter.js
Created February 1, 2017 03:40
Get or Set an object's property value based on a dot-notation key
/*
* dot-notation-setter-getter.js
*
* Created by Thomas J. Daley, J.D. on Jan 31, 2017
*
*/
"use strict";
/**
kubectl get pods | grep Evicted | awk '{print $1}' | xargs kubectl delete pod
@mdcass
mdcass / BaseTransformer.php
Last active August 25, 2022 12:52
Transformer pattern in Laravel 5
<?php
namespace App\Transformers;
/**
* Class BaseTransformer
*/
class BaseTransformer
{
/**
* The model or models to be transformed
@punyaruchal
punyaruchal / Apache_Multiple_PHP_Versions_Setup:on_macOS_High_Sierra.md
Last active March 4, 2023 08:21
MacOS 10.13 High Sierra Apache Setup: Multiple PHP Versions

Warning: Due to Homebrew/php tap being deprecated at the end of March 2018, and the moving of all PHP formulas to Homebrew/core, the installation of PHP versions we currently use is going to change. Currently PHP 7.2 is available in the core, but we are waiting on previous versions to be made available and will update this guide as soon as we can. Thanks!

Part 1: macOS 10.13 High Sierra Web Development Environment

Note: This is an updated version of our prior OS X development series. The newly released macOS 10.13 High Sierra and the accompanying updates to Brew require significant changes compared to prior releases, necessitating a thorough revamp in the process. Since 10.12 we now use Homebrew's Apache, rather than the built-in version, but this new appraoch is more flexible and should continue to work on prior OS X versions.

Developing web applications on macOS is a real joy. There are plenty of options for setting up your develop