Skip to content

Instantly share code, notes, and snippets.

@yaapis
yaapis / .gitlab-ci.yml
Last active September 17, 2021 10:34
Gitlab CI config file for deploy via SSH
before_script:
- npm -v
stages:
- setup
- codestyle
- build
- test
- deploy
@Ellrion
Ellrion / BaseModel.php
Last active December 4, 2022 23:33
Additional helper scopes for Laravel Eloquent Models: `->orderByRelation('author', 'name')`; `->orderByRelationCount('posts')`; `->withJoinnedRelated('author', 'name')`;
<?php
namespace App;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Query\Builder as QueryBuilder;
use Illuminate\Database\Query\Expression;
abstract class BaseModel extends Model
((jQuery) ->
jQuery.fn.extend incrementButtons: (options) ->
defaults =
minVal: null
maxVal: null
step: 1
incClass: "inc"
decClass: "dec"
callback: (value) ->
<?php
class Model extends \Eloquent
{
protected $observables = ['readed'];
protected static function boot()
{
parent::boot();
@rymawby
rymawby / stripe-credit-card-numbers.md
Last active April 19, 2024 13:27
Stripe test credit card numbers for use in development

#Test credit card numbers to use when developing with Stripe

4242424242424242 Visa

4012888888881881 Visa

4000056655665556 Visa (debit)

@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/