This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile | |
alias me="vi ~/.bashrc" | |
alias phptest="phpunit --include-path vendor/michaelachrisco/phpunit-progress/ --printer PHPUnit_Extensions_Progress_ResultPrinter --color" | |
#Ubuntu/Red Hat | |
#alias restart_apache="sudo service apache2 restart" | |
alias lg="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" | |
alias pa="php artisan" | |
#Add https://github.com/jimeh/git-aware-prompt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Deep symbolizes keys in hash | |
class Hash | |
def deep_sybolize_keys(value = self) | |
case value | |
when Array | |
value.map { |v| deep_sybolize_keys(v) } | |
when Hash | |
symbolize_hash(value) | |
else | |
value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
# | |
# Copyright (c) 2012 Hilton Lipschitz | |
# Copyright (c) 2013 Mischa The Evil | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining | |
# a copy of this software and associated documentation files (the | |
# "Software"), to deal in the Software without restriction, including | |
# without limitation the rights to use, copy, modify, merge, publish, | |
# distribute, sublicense, and/or sell copies of the Software, and to |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rake tasks | |
namespace :newborn_screened_disorders do | |
desc 'Import Newborn Diseases records from cdph.data.ca.gov' | |
task :race_ethnicity => :environment do | |
# https://cdph.data.ca.gov/Diseases-and-Conditions/Newborn-Screened-Disorders-by-Race-Ethnicity-2009-/ktfd-n9nb | |
client = SODA::Client.new( | |
{:domain => "cdph.data.ca.gov", | |
:app_token => Figaro.env.app_id }) | |
response = client.get("ktfd-n9nb", {:disorder_type => 'Primary Congenital Hypothyroidism'}) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# spec/support/pundit.rb | |
RSpec::Matchers.define :permit_action do |action| | |
match do |policy| | |
policy.public_send("#{action}?") | |
end | |
failure_message do |policy| | |
"#{policy.class} does not permit #{action} on #{policy.record} \ | |
for #{policy.user.inspect}." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<vector> | |
#include <memory> | |
#include <string> | |
#include "ccspec/core.h" | |
#include "ccspec/expectation.h" | |
#include "ccspec/matchers.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* In the Adapter Design Pattern, a class converts the interface of one class | |
* to be what another class expects. | |
* In this case, we use Adapters as interfaces to custom made queries. | |
*/ | |
namespace App\Adapters; | |
use DB; | |
class Adapter{ | |
public $dbConnection; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
use App\Http\Requests; | |
use App\Http\Controllers\Controller; | |
// Simple Open LDAP Object for Auth | |
class OpenLDAPAuth { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
use App\Http\Requests; | |
use App\Http\Controllers\Controller; | |
/// Microsoft LDAP Controller for authentication | |
class LDAPAuthController { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Set up Testing env | |
use Illuminate\Foundation\Testing\WithoutMiddleware; | |
// use Illuminate\Foundation\Testing\DatabaseMigrations; | |
use Illuminate\Foundation\Testing\DatabaseTransactions; | |
abstract class TestCase extends Illuminate\Foundation\Testing\TestCase | |
{ | |
/** |
OlderNewer