Skip to content

Instantly share code, notes, and snippets.

View RRStoyanov's full-sized avatar

Rostislav Stoyanov RRStoyanov

  • Sofia, Bulgaria
  • 14:10 (UTC +02:00)
View GitHub Profile
@mnshankar
mnshankar / macros
Last active March 17, 2021 19:51
Laravel 4 (Twitter Bootstrap 3.0 compliant) form macros that I commonly use
<?php
/*********************************************************************************************
* Example usage (In view)
* <div class="welcome">
<?php echo Form::open(array('route'=>'process','class'=>'form-horizontal'))?>
<?php echo Form::textField('first_name')?>
<?php echo Form::textField('last_name')?>
<?php echo Form::emailField('email')?>
<?php echo Form::passwordField('password')?>
<?php echo Form::selectField('select_one', array('1'=>'abc', '2'=>'def'))?>
@anchetaWern
anchetaWern / laravel-ums.markdown
Created December 6, 2012 11:14
Building a User Management System in Laravel

There's no shortage of good resources for learning laravel. So instead of the usual introductory tutorial were just gonna learn Laravel by building a project from scratch and that's gonna be a User Management System.

I don't know if my definition of a User Management System is correct but here's my idea of what's it's capable of doing:

  • Register Roles
  • Register Users
  • Update Users
@sgmurphy
sgmurphy / url_slug.php
Created July 12, 2012 15:52
URL Slugs in PHP (with UTF-8 and Transliteration Support)
<?php
/**
* Create a web friendly URL slug from a string.
*
* Although supported, transliteration is discouraged because
* 1) most web browsers support UTF-8 characters in URLs
* 2) transliteration causes a loss of information
*
* @author Sean Murphy <sean@iamseanmurphy.com>
* @copyright Copyright 2012 Sean Murphy. All rights reserved.
@vasilisvg
vasilisvg / more.md
Last active December 4, 2020 04:48
This is my backup script which syncs my server to my dropbox every day.

The script below is triggered every day from my Mac. I use Hazel to move the tar.gz to an external hard disk once it's finished. This happens every day without me noticing. You can exclude folders if you want to. You probably want to exclude giant cache folders.

You should have a similar script.

@RRStoyanov
RRStoyanov / Test1.php
Created March 11, 2012 14:51 — forked from snpy/Test1.php
Plain old class with multiple getters vs class with single magic method replacing multiple getters.
<?php
class Test {
public $title0 = 'string value';
public $title1 = 'string value';
public $title2 = 'string value';
public $title3 = 'string value';
public $title4 = 'string value';
public $title5 = 'string value';
public $title6 = 'string value';
@snpy
snpy / Test1.php
Last active October 1, 2015 15:37
Plain old class with multiple getters vs class with single magic method replacing multiple getters.
<?php
class Test
{
public $title0 = 'string value';
public $title1 = 'string value';
public $title2 = 'string value';
public $title3 = 'string value';
public $title4 = 'string value';
public $title5 = 'string value';
@ziadoz
ziadoz / awesome-php.md
Last active May 8, 2025 07:37
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@matthewmccullough
matthewmccullough / September-28-2011-GitHub-Office-Hours-Transcript.txt
Created September 29, 2011 03:45
September 28, 201 - GitHub Office Hours Transcript
MatthewMcC And hello everyone! Welcome to the first of many future GitHub office hours. For those of you new to Campfire, it is best if you @matthewmcc if you want to catch my attention directly. We're open to any and all questions on Git and GitHub during the hour and will try to spread the attention to everyone participating and answer as many questions as possible.
I'm Matthew McCullough, GitHub's trainer for all things Git. (https://github.com/training/online)
Mike What is the main use for submodules?
MatthewMcC @Mike Great first question. It is a multipart answer.
3:05 PM
MatthewMcC @Mike First, submodules are best for organizing an "uber app" that is composed of subcomponents. For example, some big site that has a chat module, a shopping cart, some resources, and some APIs.
@Mike Lets say that this is big enough that there are multiple teams, and each team is assigned one of those components.
@Mike The teams are likely innovating like crazy, but we can't just take their code at any time -- we need it to
@jwage
jwage / SplClassLoader.php
Last active February 22, 2026 03:20
Add MIT license.
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,