Skip to content

Instantly share code, notes, and snippets.

View silasrm's full-sized avatar

Silas Ribas Martins silasrm

View GitHub Profile
@silasrm
silasrm / index.js
Last active December 3, 2023 15:28
Entendendo a api do bibliaonline.com.br (http://jsbin.com/debagax/1/edit?html,js,output)
// Total de capítulos por livro, na ordem
var totalCapitulos = [50,40,27,36,34,24,21,4,31,24,22,25,29,36,10,13,10,42,150,31,12,8,66,52,5,48,12,14,3,9,1,4,7,3,3,3,2,14,4,28,16,24,21,28,16,16,13,6,6,4,4,5,3,6,4,3,1,13,5,5,3,5,1,1,1,22];
// Livros da bíblia
var livros = [
{
number: 1,
name: "Gênesis",
slugByLang:
{
@silasrm
silasrm / Laravel PHP7 LEMP AWS.md
Created June 21, 2017 15:04 — forked from santoshachari/Laravel PHP7 LEMP AWS.md
Laravel 5.x on Ubuntu 16.x, PHP 7.x, Nginx 1.9.x

#Steps to install latest Laravel, LEMP on AWS Ubuntu 16.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.

Install PHP 7 on Ubuntu

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip
@silasrm
silasrm / WSSoapClient.php
Created June 9, 2017 18:24 — forked from Turin86/WSSoapClient.php
WS-Security for PHP SoapClient
<?php
/**
* This class can add WSSecurity authentication support to SOAP clients
* implemented with the PHP 5 SOAP extension.
*
* It extends the PHP 5 SOAP client support to add the necessary XML tags to
* the SOAP client requests in order to authenticate on behalf of a given
* user with a given password.
*
@silasrm
silasrm / gist:3da655045b899a858eae4f4463755f5c
Last active January 31, 2023 16:03 — forked from maccath/gist:3981205
Split PDF to individual pages using FPDI and FPDF
<?php
/**
* Split PDF file
*
* <p>Split all of the pages from a larger PDF files into
* single-page PDF files.</p>
*
* @package FPDF required http://www.fpdf.org/
* @package FPDI required http://www.setasign.de/products/pdf-php-solutions/fpdi/
@silasrm
silasrm / blink.css
Created February 25, 2017 19:44 — forked from mugifly/blink.css
CSS Blink for Webkit and others. (Chrome, Safari, Firefox (Gecko), IE, ...) CSSで擬似的なblinkを再現する簡単なTips。
<?php
/*
Plugin Name: bbPress - Custom KSES Allowed Tags
Plugin URI: https://gist.github.com/ntwb/7797990
Description: bbPress - Custom KSES Allowed Tags
Version: 0.2
Author: Stephen Edgar - Netweb
Author URI: http://netweb.com.au
*/
<?php
public function buscaParceiro(Request $request){
$string = $request->get('pesquisa');
$parceiro = DB::table('usuario')
->join('pessoa', 'pessoa.filho_id', '=', 'usuario.id')
->where('usuario.filho_type', '=', "'CompraSerrana\Parceiro'")
->where('pessoa.nome', 'LIKE', "%$string%")
->get();
@silasrm
silasrm / jquery.parseparams.js
Created October 13, 2016 22:21 — forked from kares/jquery.parseparams.js
jQuery.parseParams - parse query string paramaters into an object
/**
* $.parseParams - parse query string paramaters into an object.
*/
(function($) {
var re = /([^&=]+)=?([^&]*)/g;
var decodeRE = /\+/g; // Regex for replacing addition symbol with a space
var decode = function (str) {return decodeURIComponent( str.replace(decodeRE, " ") );};
$.parseParams = function(query) {
var params = {}, e;
while ( e = re.exec(query) ) {
@silasrm
silasrm / install-comodo-ssl-cert-for-nginx.rst
Created September 22, 2016 04:55 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@silasrm
silasrm / git-change-commit-messages.md
Created July 24, 2016 20:06 — forked from nepsilon/git-change-commit-messages.md
How to change your commit messages in Git? — First published in fullweb.io issue #55

How to change your commit messages in Git?

At some point you’ll find yourself in a situation where you need edit a commit message. That commit might already be pushed or not, be the most recent or burried below 10 other commits, but fear not, git has your back 🙂.

Not pushed + most recent commit:

git commit --amend

This will open your $EDITOR and let you change the message. Continue with your usual git push origin master.