Skip to content

Instantly share code, notes, and snippets.

View shekarsiri's full-sized avatar
👋

Shekar Siri shekarsiri

👋
View GitHub Profile
@laracasts
laracasts / ApiTester.php
Created April 9, 2014 23:53
Incremental APIs: Level 9 - Tests (Readable Ones!)
<?php
use Faker\Factory as Faker;
class ApiTester extends TestCase {
/**
* @var Faker
*/
protected $fake;
@ajhekman
ajhekman / app.coffee
Last active August 29, 2015 14:00
MH Blog AngularJS Property Model
angular.module("app", [ "ngRoute" ]).run ($rootScope, UserService) ->
#Avoid $rootScope if you can. User and Session info is about all that should go on $rootScope.
#UserService.getUserByID(1).then (user)->
# $rootScope.user = user
@msurguy
msurguy / list.md
Last active January 26, 2018 15:16
List of CMSs built with Laravel (stable and in dev)
@thewinterwind
thewinterwind / log_laravel_db_queries_to_console.php
Created May 4, 2014 05:59
Log Laravel 4 Database Queries to the Console
@if (App::environment() == 'local')
@foreach (DB::getQueryLog() as $query)
<script>console.log(' {{ $query['query'] . ' (' . $query['time'] . ' secs)' }} ')</script>
@endforeach
@endif
@laracasts
laracasts / MailTestCase.php
Created June 14, 2014 22:35
Use Mailcatcher to test email.
<?php
use GuzzleHttp\Message\Response;
class MailTestCase extends TestCase {
protected $mailcatcher;
function __construct()
{
@laracasts
laracasts / StatusRepository.php
Last active May 19, 2018 15:11
Integration Testing Repositories That Use Eloquent (with Codeception)
<?php namespace Larabook\Statuses;
use Larabook\Users\User;
class StatusRepository {
/**
* Get all statuses associated with a user.
*
* @param User $user
@laracasts
laracasts / Gulpfile.js
Created August 20, 2014 20:47
PHPSpec auto-testing Gulpfile
var gulp = require('gulp');
var phpspec = require('gulp-phpspec');
var run = require('gulp-run');
var notify = require('gulp-notify');
gulp.task('test', function() {
gulp.src('spec/**/*.php')
.pipe(run('clear'))
.pipe(phpspec('', { notify: true }))
.on('error', notify.onError({
@krosenberg
krosenberg / Backbone.ShowMoreCollection.js
Created September 4, 2014 18:05
A ShowMoreCollection for client-side-paginated Backbone.PageableCollection
/*
showMore() Adds more models to the first page of a pageable collection.
It does this by resetting the collection to the current collection plus a number of models
from fullCollection, and increases the page size to the number of currently-visible models.
*/
Backbone.ShowMoreCollection = Backbone.PageableCollection.extend({
showMore: function(num) {
var num = num || 10;
var state = this.state;
var pageNum = state.currentPage;
@skyfishjy
skyfishjy / CursorRecyclerViewAdapter.java
Last active March 18, 2025 21:07
CursorRecyclerViewAdapter
/*
* Copyright (C) 2014 [email protected]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@hackel
hackel / SentryAuthAdapter.php
Last active June 24, 2021 14:48
SentryAuthAdapter for using Tymon\JWTAuth with Cartalyst\Sentry
<?php namespace MyApp\Providers;
use Exception;
use Cartalyst\Sentry\Sentry;
use Cartalyst\Sentry\Users\UserInterface;
use Tymon\JWTAuth\Providers\Auth\AuthInterface;
class SentryAuthAdapter implements AuthInterface
{
/**