Skip to content

Instantly share code, notes, and snippets.

View burakerdem's full-sized avatar
🏠
Working from home

Burak Erdem burakerdem

🏠
Working from home
View GitHub Profile
@garagesocial
garagesocial / filters.php
Last active February 6, 2023 04:11 — forked from zmsaunders/filters.php
Laravel Filter Helper - Compress HTML Output & Strip Comments
<?php
### --- Snip --- ###
App::after(function($request, $response)
{
// HTML Minification
if(App::Environment() != 'local')
{
if($response instanceof Illuminate\Http\Response)
@jasonlewis
jasonlewis / create-project.sh
Last active January 25, 2025 20:13
Bash script that creates a new project and virtual host for that project. Can also be used to quickly create a new Laravel project.
#!/bin/bash
# This script creates a new project (or site) under /var/sites and creates
# new virtual host for that site. With the options a site can also
# install the latest version of Laravel directly.
# This script was originally based on the following script by @Nek from
# Coderwall: https://coderwall.com/p/cqoplg
# Display the usage information of the command.
create-project-usage() {
@jeremyvaught
jeremyvaught / my_steps_to_create_virtual_box.sh
Last active December 31, 2015 13:29
My notes on installing Ubuntu 13.10 Server in VirtualBox on my Mac. Also, this is not intended to be an actual shell script, just a list of commands to copy and paste
# ... pre-writing it down, but basically install the OS
# then update
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
# Ubuntu comes with tasksel, so going with that
sudo tasksel # choose openSSH server and LAMP, Basic Ubuntu Server will have already been chosen. These can also be chosen during the install process but I found it may make for a less smooth install process
# So I can install the iso and other things into the future
@isimmons
isimmons / gist:8202227
Last active July 26, 2024 16:15
Truncate tables with foreign key constraints in a Laravel seed file.

For the scenario, imagine posts has a foreign key user_id referencing users.id

public function up()
{
	Schema::create('posts', function(Blueprint $table) {
		$table->increments('id');
		$table->string('title');
		$table->text('body');
@elena-kolevska
elena-kolevska / validators.php
Last active June 24, 2021 14:44
Custom alphabetic validator that allows spaces
<?php
/* app/validators.php */
Validator::extend('alpha_spaces', function($attribute, $value)
{
return preg_match('/^[\pL\s]+$/u', $value);
});
/*
@danharper
danharper / BaseCollection.php
Created January 24, 2014 12:34
Laravel/Eloquent Collection method to sort by a comma-separated string of IDs. Any models which do not appear in the given order are added to the end in ID order.
<?php
use Illuminate\Database\Eloquent\Collection;
class BaseCollection extends Collection {
public function sortByOrder($order, $delimeter = ',')
{
$order = is_array($order) ? $order : explode($delimeter, $order);
@vertexclique
vertexclique / cracking.md
Last active February 22, 2025 13:20
Cracking guide for Sublime Text 3 Build 3059 / 3065 ( Mac / Win x86_64 / Windows x86 / Linux x64 / Linux x86 )

MacOS

Build 3059

MD5: 59bab8f71f8c096cd3f72cd73851515d

Rename it to: Sublime Text

Make it executable with: chmod u+x Sublime\ Text

@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active March 27, 2025 17:19
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository