Skip to content

Instantly share code, notes, and snippets.

angular.module('minhasDiretivas', [])
.directive('meuPainel', function()
{
var ddo = {}; //criando a variavel ddo
ddo.restric = "AE"; //definindo o que vai poder usar o ddo
ddo.scope = { //criando um scope
titulo: '@'
};
// validando campo de codigo para somente numeros
int error;
do
{
error = 0;
cout << "Código do cliente entre 1 e " << QTDE_CLIENTES << endl << "Ou zero para cancelar a transaçao: ";
cin >> nCodigo;
if (cin.fail())
{
cout << "Entre um codigo valido" << endl;
@anderson-marin26
anderson-marin26 / Escola.cpp
Created June 2, 2016 15:52
Prova P2 Bortot
// Programa Escola de Natação - Prova N2 - 01/06/2016 - Turma da Tarde
//
#include "Escola.h"
// Entry point do programa
//
void main(void)
{
int nPeriodo, // periodo da aula de natação
nRaia, // raia da piscina
nPosicionalRaia, // posicional da raia dentro do arquivo de raias
import mysql.connector
cnx = mysql.connector.connect(user='root', password='canalwebx', host='127.0.0.1', database='test')
cursor = cnx.cursor()
query = ("SELECT * FROM test")
cursor.execute(query)
for result in cursor:
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$serverName = "192.168.0.95";
$connectionOptions = array(
"Database" => "vanrooycrm_2",
"Uid" => "sa",
"PWD" => "VanrooY2015"
$new_date = date("d/m/Y", strtotime($old_date));
<?php
$rec_limit = 20;
$sql = $con_cdr->prepare($query_count);
$sql->execute();
$rec_count = $sql->fetch(PDO::FETCH_ASSOC);
$rec_count = $rec_count['count'];
@anderson-marin26
anderson-marin26 / capsule_example.php
Created July 14, 2017 12:11
Eloquent Capsule Example
<?php
require "vendor/autoload.php";
use Illuminate\Database\Capsule\Manager as Capsule;
$capsule = new Capsule();
$array = array(
'driver' => 'mysql',
'host' => '127.0.0.1',
'database' => 'db_name',
@anderson-marin26
anderson-marin26 / twig_loader.php
Created July 14, 2017 12:15
Twig Loader Example
<?php
require "../vendor/autoload.php";
$loader = new Twig_Loader_Filesystem('../view/');
$twig = new Twig_Environment($loader);
?>
@anderson-marin26
anderson-marin26 / originate_call.php
Last active July 11, 2019 09:30 — forked from anpel/originate_call.php
Originate a call from Asterisk using PHP and Asterisk Manager Interface
/**
* Once this scipt is executed it will connect to the local port you have assigned to
* Asterisk (default: 5038) and send an authentication request. If successfull, it will
* send a second request to originate your call.
*
* The internal SIP line $internalPhoneline will be dialed, and when picked up the
* $target phone will be dialed using your outbound calls context ($context).
*
* Of course, you can modify the commands sent to the asterisk manager interface to suit your needs.
* you can find more about the available options at: