Skip to content

Instantly share code, notes, and snippets.

View lasergoat's full-sized avatar

Daniel lasergoat

  • Fattmerchant
  • US
View GitHub Profile
@lasergoat
lasergoat / array_only.php
Last active July 18, 2016 20:25
A simple solution for laravel's array helper called `array_only()` which support dot
<?php
public function array_only($original, $keeping)
{
// remove the following keys from the rendered bill object
$arr = [];
foreach ($keeping as $key)
{
@lasergoat
lasergoat / MainController.js
Created March 1, 2016 17:10
Angular Geo Location Snippet
var app = angular.module('app', []);
app.factory('geoLoc', ['$q', '$window', function ($q, $window) {
'use strict';
return {
currentPosition: function() {
var deferred = $q.defer();
@lasergoat
lasergoat / unit-test.js
Created March 13, 2015 21:09
example of unit testing the controller within a directive
describe('Common: recordDirective', function() {
var $scope, $stateParams, $state, $compile, $q, element, makeHtml;
// each test in this file MUST call this method
// to customize var form and var $scope for itself
makeHtml = function(nonClickable) {
// $scope = $scope.$new();