Skip to content

Instantly share code, notes, and snippets.

View patrickmarino's full-sized avatar
:octocat:
I may be slow to respond.

Patrick Mariño patrickmarino

:octocat:
I may be slow to respond.
View GitHub Profile
@patrickmarino
patrickmarino / WSSoapClient.php
Created August 21, 2020 08:28 — forked from mathdev/WSSoapClient.php
WS-Security for PHP SoapClient
<?php
/**
* Copyright (c) 2007, Roger Veciana
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
@patrickmarino
patrickmarino / Response.php
Created June 1, 2020 06:55 — forked from jeffochoa/Response.php
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;
@patrickmarino
patrickmarino / deploy.rb
Created June 20, 2018 09:44 — forked from reu/deploy.rb
Capistrano deploy recipe for database configuration
# Bundler Integration
require "bundler/capistrano"
# Application Settings
set :application, "yourapplicationname"
set :user, "serveruser"
set :deploy_to, "/home/#{user}/rails-applications/#{application}"
set :rails_env, "production"
set :use_sudo, false
set :keep_releases, 3
@patrickmarino
patrickmarino / rspec_rails_cheetsheet.rb
Created February 21, 2017 00:04 — forked from them0nk/rspec_rails_cheetsheet.rb
Rspec Rails cheatsheet (include capybara matchers)
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)
@patrickmarino
patrickmarino / magento-nginx.conf
Created March 4, 2016 08:54 — forked from gwillem/magento-nginx.conf
Battle-tested Nginx configuration for Magento (source: www.hypernode.com)
# This is an annotated subset of the Nginx configuration from our Magento production platform @ www.hypernode.com
# See https://www.byte.nl/blog/magento-cacheleak-issue
user app;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 768;
}