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
@srph
srph / starters
Created November 24, 2014 23:55
Git in 5
git init
git remote add origin <GIT_REPOSITORY_LINK>
git add .
git commit -m "<MESSAGE>"
git push origin master
@srph
srph / routes.php
Last active August 29, 2015 14:10
laravel route groups example
<?php
// Home
Route::get('/', '...');
// @link (ourdomain.com)/dashboard/*
Route::group(['prefix' => 'dashboard'], function() {
// For authentication purposes
// No need for filter
// @link (ourdomain.com)/dashboard/(login|logout)
Route::get('login', '..');
@srph
srph / PogiController.php
Created November 26, 2014 16:40
laravel.eloquent - saving a relationship's id
<?php
class PogiController extends BaseController {
/**
* Store.
* @why Cause fock u thats why
* @return my fock
*/
public function store() {
<!DOCTYPE html>
<html>
<head>
<title>Ateneo Hacks - Registration: {{ e($teamName) }}</title>
<meta charset="utf-8">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,700italic,400,300,600,700' rel='stylesheet' type='text/css'>
<style>
html, body {
font-family: 'Open Sans', Helvetica, Helvetica Neue, serif, sans-serif;
width: 500px;
@srph
srph / readme.md
Last active August 29, 2015 14:10
React Flash - Design Goals

Design Goals

Basic goals

  1. Prioritizes simplicity of API
  2. Flash has a timer which causes it to die after few seconds (or given time)
  3. Flash timer stops when hovered
  4. Able to add flash
  5. Able to remove flash
  6. Able to flush flash
@srph
srph / MessageMixin.jsx
Created December 4, 2014 09:48
message
var MessageMixin = {
componentDidMount: function() {
this.tick()
}
tick: function() {
var duration = 10000;
var remove = this.remove.bind(this);
var timer = setTimeout(remove, duration);
this.setState({ timer: timer });
<?php
require_once ('BaseController.php');
class FormsController extends BaseController
{
protected $formRepository;
protected $employeeRepository;
protected $formApplicationRepository;
protected $leaveCreditsRepository;
@srph
srph / PostActions.jsx
Last active August 29, 2015 14:11
reflux sample (best practices) attempt
var Reflux = require('reflux');
module.exports = Reflux.createAction([
// other things
onCreateSuccess,
onCreateError
]);
@srph
srph / angular-timestamp-filter.js
Created December 17, 2014 13:53
Angular Timestamp Filter
+(function(angular, undefined) {
'use strict';
angular
.module('app')
.filter('timestamp', filter);
function filter() {
return function filterFn(input) {
return ( Date.parse(input) );
}
@srph
srph / ProductController.js
Last active January 16, 2024 14:13
Example for Writing Better AngularJS Apps https://medium.com/p/f2ab70a104d0/
// Our html would be,
// <product-search="productCtrl.filter"></product-table>
// <product-table="productCtrl.data"></product-table>
// Controller As productCtrl
angular
.module('app')
.controller('ProductController', ProductController);
function ProductController($scope, $http) {