This file contains hidden or 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
/*! | |
Math.uuid.js (v1.4) | |
http://www.broofa.com | |
mailto:[email protected] | |
Copyright (c) 2010 Robert Kieffer | |
Dual licensed under the MIT and GPL licenses. | |
*/ | |
/* |
This file contains hidden or 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
function boldText(text){ | |
var bold = /\*\*(\S(.*?\S)?)\*\*/gm; | |
var html = text.replace(bold, '<b>$1</b>'); | |
return html; | |
} | |
var result = boldText('te**st**ing'); | |
alert(result); |
This file contains hidden or 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
class GitHubUser { | |
async data(cb) { | |
let users = await $.get('http://api.github.com/users/alexalannunes'); | |
cb(users); | |
} | |
} | |
var user = new GitHubUser(); | |
user.data(users => { |
This file contains hidden or 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
app.directive("corMediaSigaBadge", function() { | |
return { | |
restrict: "A", | |
template: `<span class="badge {{class}}">{{value}}{{showPercent ? '%' : ''}}</span>`, | |
scope: { | |
value: "=", | |
showPercent: "=" // boolean | |
}, | |
link: function($scope, $elem, $attr) { |
This file contains hidden or 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 | |
ini_set('display_errors',1); | |
ini_set('display_startup_erros',1); | |
error_reporting(E_ALL); | |
try { | |
$pdo = new PDO('pgsql:host=localhost;dbname=postgres', 'postgres', 'a0l11e4x23'); | |
} |
This file contains hidden or 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
$(".summernote").summernote({ | |
height: 300, // set editor height | |
minHeight: null, // set minimum height of editor | |
maxHeight: null, // set maximum height of editor | |
focus: true, // set focus to editable area after initializing summernote | |
codemirror: { | |
// codemirror options | |
theme: "monokai" | |
}, | |
toolbar: [ |
This file contains hidden or 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 | |
header("Access-Control-Allow-Origin: *"); | |
header("Access-Control-Allow-Credentials: true"); | |
header("Access-Control-Allow-Methods: GET,HEAD,OPTIONS,POST,PUT"); | |
header("Access-Control-Allow-Headers: Access-Control-Allow-Headers, Origin,Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers"); | |
// ou | |
header("Access-Control-Allow-Origin: * "); | |
header("Content-Type: application/json; charset=UTF-8"); | |
header("Access-Control-Allow-Methods: POST"); |
This file contains hidden or 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
sudo apt install xserver-xorg-core && sudo apt install xorg-input-abi-22 && sudo apt install xserver-xorg-input-libinput |
This file contains hidden or 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 | |
define('DRIVER', 'pgsql'); | |
define('HOST', 'localhost'); | |
define('USER', 'postgres'); | |
define('PASS', 'a0l11e4x23'); | |
define('DATABASE', 'alexalannunes'); | |
define('OPTIONS', array( | |
PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8", | |
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, | |
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ, |
This file contains hidden or 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 | |
// intervalo de datas | |
// 1 day | |
// 30 minutes | |
$d1 = '2019-01-01'; | |
$d2 = '2019-01-20'; | |
$i = 0; | |
while ($d1 <= $d2) { | |
// echo $i. '<br>'; | |
OlderNewer