Skip to content

Instantly share code, notes, and snippets.

View enieber's full-sized avatar
🚧
decentralizing the world

Enieber Cunha enieber

🚧
decentralizing the world
View GitHub Profile
@enieber
enieber / odoo_wrapper.py
Created March 22, 2024 19:28 — forked from rafnixg/odoo_wrapper.py
Odoo shell enviroment wrapper for executre custom code
import sys
def execute_script(env, script_path):
# Importa el archivo de script como un modulo
import importlib.util
spec = importlib.util.spec_from_file_location("module.name", script_path)
script_module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(script_module)
# Ejecuta la función 'run' del modulo importado
@enieber
enieber / example-typeorm-jest.test.ts
Created February 16, 2022 04:58 — forked from Ciantic/example-typeorm-jest.test.ts
Example of testing TypeOrm with Jest and Sqlite in-memory database
import { createConnection, getConnection, Entity, getRepository } from "typeorm";
import { PrimaryGeneratedColumn, Column } from "typeorm";
@Entity()
export class MyEntity {
@PrimaryGeneratedColumn()
id?: number;
@Column()
name?: string;
@enieber
enieber / clean-up-arch-linux.md
Created August 30, 2021 07:21 — forked from rumansaleem/clean-up-arch-linux.md
Instructions to clean up Arch Linux (Manjaro)

Contents

  • Clean pkg cache
  • Remove unused packages (orphans)
  • Clean cache in /home
  • remove old config files
  • Find and Remove
    • duplicates
    • empty files
    • empty directories
  • broken symlinks
@enieber
enieber / post-login.js
Last active January 22, 2019 13:18 — forked from devsergioramos/post-login.js
Function js de post para login
const getContentForm = () => $('form#conteudo');
const getDadosFormLogin = () => {
const usuario = $("input#usuario").val();
const senha = $("input#senha").val();
const form = {
usuario,
senha,
};
return form;
@enieber
enieber / quartis.js
Last active February 13, 2017 04:27 — forked from wdiasvargas/quartis.js
function getSizeArray(arr) {
return arr.lenth
}
function getModule2(arr) {
let size = getSizeArray(arr)
return size % 2 == 0
}
function getDivide2(arr) {
@enieber
enieber / gist:c3f849a76607e8e4e579c2464f759338
Created August 23, 2016 17:24 — forked from dodyg/gist:5823184
Kotlin Programming Language Cheat Sheet Part 1

#Intro

Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at kotlin.jetbrains.org.

All the codes here can be copied and run on Kotlin online editor.

Let's get started.

Manifesto MicroPHP

Eu sou um desenvolvedor PHP

  • Eu não sou um desenvolvedor Zend Framework ou Symfony ou CakePHP
  • Eu acho que o PHP é complicado o suficiente

Eu gosto de construir coisas pequenas

  • Eu gosto de construir coisas pequenas com efeitos simples
  • Eu gosto de fazer coisas que resolvem problemas
  • Eu gosto de construir coisas pequenas que trabalham em conjunto para resolver problemas maiores
<?php
public function relatorio_jornada() {
$req = $this->request->is('post');
if ($req) {
$newPost = $this->request->data;
$data_init = $newPost['Jornada']['dt_inicio'];
$data_finit = $novo['Jornada']['dt_final'];