Skip to content

Instantly share code, notes, and snippets.

View IgorDePaula's full-sized avatar
😆

Igor C. de Paula IgorDePaula

😆
View GitHub Profile
import React, {Component, Context, useState, useContext} from 'react';
import {
ActivityIndicator,
KeyboardAvoidingView,
ScrollView,
StyleSheet,
Text,
View,
} from 'react-native';
import {Button, TextInput} from 'react-native-paper';
@IgorDePaula
IgorDePaula / main.go
Created July 22, 2020 22:57
Go lendo arquivo yml
package main
import (
"fmt"
"github.com/goccy/go-yaml"
"io/ioutil"
"log"
)
type conf struct {
Hits int64 `yaml:"hits"`
Time int64 `yaml:"time"`
@IgorDePaula
IgorDePaula / main.c
Created July 21, 2020 23:00
programa do elton
#include <stdio.h>
#include <stdlib.h>
#ifdef __unix__
#define IS_POSIX 1
#else
#define IS_POSIX 0
#endif
<template>
<div id="app">
<div v-for="item in list" :key="item">{{item}}</div>
<button @click="setPage(page-1)" :disabled="page==1">Anterior</button>
{{page}}/500
<button @click="setPage(page+1)" :disabled="page>list.length-1">Proximo</button>
{{page}}
</div>
</template>
@IgorDePaula
IgorDePaula / main.c
Last active July 18, 2020 01:56
Interpolacao linear em C
#include <stdio.h>
double linearInterpolation(double x0, double y0, double x1, double y1, double x) {
return y0 + (y1 - y0) * ((x - x0) / (x1 - x0));
}
void chamaLinearInterpolation(){
float x, x0, y0, x1, y1, i;
printf("Digite o fator X: ");
scanf("%f", &x);
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
#painel{
display: block;
background-color: #f00;
width:200px;
const Comp = () => {
let listUfs = ufs.map(uf =>{
return { label: uf, value: uf }
})
return <RNPickerSelect
onValueChange={(value) => console.log(value)}
items={listUfs}
/>
}
@IgorDePaula
IgorDePaula / composer.json
Created March 22, 2020 00:08 — forked from andyshinn/composer.json
Docker Compose PHP Composer Example
{
"require": {
"mfacenet/hello-world": "v1.*"
}
}
@IgorDePaula
IgorDePaula / post-receive
Created March 18, 2020 15:12
deploy via git
#!/bin/bash
TARGET="/var/www/html"
GIT_DIR="/home/ubuntu/crm.git"
BRANCH="master"
TARGET_HOMOLOGACAO="/home/ubuntu/homologacao"
BRANCH_HOMOLOGACAO="homologacao"
while read oldrev newrev ref
do
# only checking out the master (or whatever branch you would like to deploy)
@IgorDePaula
IgorDePaula / Tray.js
Created February 27, 2020 17:12
Tray.js
import { app, BrowserWindow, nativeTheme, Menu, Tray, nativeImage } from 'electron'
const path = require('path')
let tray = null
try {
if (process.platform === 'win32' && nativeTheme.shouldUseDarkColors === true) {
require('fs').unlinkSync(require('path').join(app.getPath('userData'), 'DevTools Extensions'))
}
} catch (_) { }