Skip to content

Instantly share code, notes, and snippets.

View jrbarros's full-sized avatar

Joalisson Barros jrbarros

View GitHub Profile
-- Define delimitador
DELIMITER $$
CREATE PROCEDURE UpdateWithoutLock()
BEGIN
SET @id_start := 0;
loop_label: LOOP
-- Faz a busca por 1000
SELECT @id_end := MAX(tmp.id)
FROM (
SELECT id
<?php
// Substitua os valores abaixo pelas credenciais do seu banco de dados
$host = '127.0.0.1';
$dbname = 'hotmilhas';
$user = 'root';
$password = 'root';
$dsn = "mysql:host=$host;dbname=$dbname";
$options = [
@jrbarros
jrbarros / install_oci8_ubuntu_16.04_php7.1.md
Created March 18, 2020 20:53 — forked from hewerthomn/install_oci8_ubuntu_16.04_php7.1.md
How to install OCI8 on Ubuntu 16.04 and PHP 7.1
@jrbarros
jrbarros / parse-xml.php
Created September 7, 2018 02:32 — forked from stojg/parse-xml.php
Parsing a huge XML with closure in PHP
<?php
// Open the XML
$handle = fopen('file.xml', 'r');
// Get the nodestring incrementally from the xml file by defining a callback
// In this case using a anon function.
nodeStringFromXMLFile($handle, '<item>', '</item>', function($nodeText){
// Transform the XMLString into an array and
print_r(getArrayFromXMLString($nodeText));
# encoding=utf8
import requests
import csv
import os
import urllib
import re
import sys
reload(sys)
@jrbarros
jrbarros / ExtendedArrayCollection.php
Created April 16, 2018 18:00 — forked from jamesmoey/ExtendedArrayCollection.php
Extend array collection from Doctrine with operation to perform on all the item in the collection.
<?php
namespace Collections;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\PropertyAccess\PropertyAccess;
class ExtendedArrayCollection extends ArrayCollection
{
/**
to check if the server works - https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice
stun:
stun.l.google.com:19302,
stun1.l.google.com:19302,
stun2.l.google.com:19302,
stun3.l.google.com:19302,
stun4.l.google.com:19302,
stun.ekiga.net,
stun.ideasip.com,
@jrbarros
jrbarros / stuns
Created December 15, 2017 12:41 — forked from yetithefoot/stuns
STUN+TURN servers list
{url:'stun:stun01.sipphone.com'},
{url:'stun:stun.ekiga.net'},
{url:'stun:stun.fwdnet.net'},
{url:'stun:stun.ideasip.com'},
{url:'stun:stun.iptel.org'},
{url:'stun:stun.rixtelecom.se'},
{url:'stun:stun.schlund.de'},
{url:'stun:stun.l.google.com:19302'},
{url:'stun:stun1.l.google.com:19302'},
{url:'stun:stun2.l.google.com:19302'},