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
import { StatusBar } from "expo-status-bar"; | |
import React, { useEffect } from "react"; | |
import { StyleSheet, Text, View, Animated, Easing } from "react-native"; | |
import { PanGestureHandler, State } from "react-native-gesture-handler"; | |
export default function App() { | |
let offset = 0; | |
let y = new Animated.Value(0); | |
const _onPanGestureEvent = Animated.event([{ nativeEvent: { translationY: y } }], { useNativeDriver: false }); |
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 _treat_model_form() { | |
let model = angular.copy(vm.filter); | |
for (let m in model) { | |
const value = model[m]; | |
model[m] = | |
value == null || value.length == 0 | |
? "" | |
: Array.isArray(value) | |
? value.join(",") // para metodos GET|DELETE |
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
/** | |
* download de um arquivo | |
* | |
* @param {Blob} file | |
* @example | |
* ... | |
* exec(response.data) | |
* ... | |
*/ | |
function exec(file, type = "text/csv") { |
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 | |
function dataCompetencia($data) | |
{ | |
$dia = (int) substr($data, 8, 2); | |
$AnoMes = substr($data, 0, 7); | |
if ($dia >= 26) { | |
$date['inicial'] = $AnoMes . '-26'; | |
$date['final'] = date('Y-m', strtotime('+ 1 Month', strtotime($AnoMes))) . '-25'; | |
} else { |
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 prettyPrintNumber(number) { | |
var numberString; | |
var scale = ""; | |
if (isNaN(number) || !isFinite(number)) numberString = "N/A"; | |
else { | |
var negative = number < 0; | |
number = negative ? -number : number; | |
if (number < 1E3) scale = ""; | |
else if (number < 1E6) { | |
scale = "K"; |
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
vm.count = function() { | |
var root = angular.element(document.getElementsByTagName("body")); | |
var watchers = []; | |
var f = function(element) { | |
angular.forEach(["$scope", "$isolateScope"], function(scopeProperty) { | |
if (element.data() && element.data().hasOwnProperty(scopeProperty)) { | |
angular.forEach(element.data()[scopeProperty].$$watchers, function( | |
watcher |
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
angular | |
.module('home', []) | |
.controller('home_ctrl', function ($scope, $q, $http) { | |
$scope.title = 'Home'; | |
let vm = $scope; | |
let cancelador = $q.defer(); | |
vm.buscar = () => { |
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>'; | |
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
sudo apt install xserver-xorg-core && sudo apt install xorg-input-abi-22 && sudo apt install xserver-xorg-input-libinput |