Skip to content

Instantly share code, notes, and snippets.

View pajcho's full-sized avatar
:octocat:
Make it work, make it right, make it fast

Nikola Pajic pajcho

:octocat:
Make it work, make it right, make it fast
View GitHub Profile
@dhrrgn
dhrrgn / paths.php
Last active December 20, 2015 09:08
A few handy functions for dealing with paths in PHP in a cross-platform environment.
<?php
if ( ! defined('IS_WIN')) {
define('IS_WIN', (DIRECTORY_SEPARATOR === '\\'));
}
/**
* Normalizes and joins path segments in accordance with the current OS standard.
*
* Usage:
*
@dhrrgn
dhrrgn / .gitattributes
Last active December 19, 2015 12:18
Stop hoping that other's core.autocrlf is set correctly. Add this .gitattributes to the root of your repo. Add any specific files to ensure Git doesn't try anything funny on you. If you think i missed a common extension, let me know in the comments. See here for more details: http://timclem.wordpress.com/2012/03/01/mind-the-end-of-your-line/
# Ensures all line endings are committed as LF, but will checkout with native line endings
* text=auto
# -- Override Section, just in-case Git tries to be sneaky
# Ensure that these files are recognized as text
*.asp text
*.aspx text
*.asx text
*.c text
@akuzemchak
akuzemchak / DeployCommand.php
Created July 8, 2013 17:20
Basic Laravel deployment script
<?php
// app/commands/DeployCommand.php
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class DeployCommand extends Command
{
@akuzemchak
akuzemchak / l4project.sh
Last active November 16, 2023 08:48
New L4 project with clean history
# Initial setup
git clone -o framework -b develop https://github.com/laravel/laravel.git project-name
cd project-name
git checkout --orphan master
git commit -m "Initial commit"
# Pulling changes
git fetch framework
git merge --squash -m "Upgrade Laravel" framework/develop
# Fix merge conflicts if any and commit