Skip to content

Instantly share code, notes, and snippets.

View srph's full-sized avatar
🛠️
Building @Stride-Labs Frontend

Kier Borromeo srph

🛠️
Building @Stride-Labs Frontend
View GitHub Profile
<?php namespace Acme\Repositories;
use Acme\Repositories\UserRepositoryInterface;
class EloquentUserRepository extends EloquentBaseRepository implements UserInterface {
// left blank for brevity
}
<?php
use Acme\Repositories\Interfaces\User as UserRepository;
class UserController extends BaseController {
// left blank for brevity
}
<?php namespace Acme\Repositories\Eloquent;
use Acme\Repositories\Interfaces\User as UserInterface;
class User extends Base implements UserInterface {
// left blank for brevity
}
@srph
srph / algo.txt
Created September 8, 2014 14:50
Banking (COBOL)
Algo
1. Welcoming Screen
- press any key to continue
2. next screen with 2 options :
- if the user has already an account
- if the user hasn't got yet an account
2.a. if the user hasn't got yet an account
@srph
srph / ctrl.js
Created September 12, 2014 03:16
smart-table hide/show-columns
function AffiliationCtrl ($scope, AffiliationSrvc) {
var hiddenColumns = [];
var positionOf = function (column) {
return hiddenColumns.indexOf(column);
};
/**
* Checks if a column is hidden
* @param {[type]} column [description]
Here's a summary of my implementation. Everything is through data-binding which seems to be non-performant.
- Each column has the button to hide column
- Each column is hidden if it is found in the array of hidden columns
- When it is clicked, it added to the array of hidden columns
- To show it back, I have a <select> (Default value is ''). When its value changes with ng-change, it removes the column in the array of hidden column.
Here's my idea
To hide:
@srph
srph / auth.spec.js
Created September 12, 2014 08:24
$httpBackend DRY - Jasmine
describe('Authentication Service', function() {
beforeEach(module('app'));
beforeEach(module('stateMock'));
var $httpBackend, $state, srvc;
var checkHandler;
var guestHandler;
var dataHandler;
var loginHandler;
@srph
srph / directive.js
Last active February 17, 2017 14:09
smart-table toggle-hide-column reusable component attempt
function hideColumn () {
var template = '<span ng-transclude></span>' +
'<button ng-click="hideColumn()">Hide</button>'
function link (scope, element, attrs ) {
scope.hideColumn = function () {
console.log('Called');
var label = '[label=' + scope.label + ']';
var element = angular.element(label);
var index = element.index() + 1;
@srph
srph / AngularJS-js-completions.json
Created September 13, 2014 06:15
AngularUI's AngularJS Sublime Package - Remove inline annotation
{
"js_completions": [
["config\tAngularJS", "config(function ($1) {\n\t$2\n});"],
["constant\tAngularJS", "constant('${1:name}', ${2:value});"],
["controller\tAngularJS", "controller('${1:name}', function ($2) {\n\t$3\n});"],
["factory\tAngularJS", "factory('${1:name}', function ($2) {\n\treturn ${3} {\n\t\t$4\n\t};\n});"],
["run\tAngularJS", "run('${1:name}', function ($2) {\n\t$3\n});"],
["service\tAngularJS", "service('${1:name}', function($2) {\n\t$3\n});"],
["value\tAngularJS", "value('${1:name}', ${2:value});"]
]
package controllers;
import play.*;
import play.mvc.*;
import views.html.*;
public class Application extends Controller {
public static Result index() {