Skip to content

Instantly share code, notes, and snippets.

View akevinieron's full-sized avatar

Kevin Jimenez akevinieron

  • Santo Domingo, República Dominicana
View GitHub Profile
@akevinieron
akevinieron / delete_git_submodule.md
Created February 16, 2022 18:12 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
[options]
#
# WARNING:
# If you use the Odoo Database utility to change the master password be aware
# that the formatting of this file WILL be LOST! A copy of this file named
# /etc/odoo/openerp-server.conf.template has been made in case this happens
# Note that the copy does not have any first boot changes
#-----------------------------------------------------------------------------
# Odoo Server Config File - TurnKey Linux
@akevinieron
akevinieron / date_compare.py
Created August 31, 2018 22:21 — forked from ilyasProgrammer/date_compare.py
Odoo compare datetime and date in domain. Current day, week, month, year in domain.
# in xml:
# Current day:
domain="[('some_date_time', '>', (context_today()-datetime.timedelta(days=1)).strftime('%%Y-%%m-%%d')),('start_time', '<', (context_today()+datetime.timedelta(days=1)).strftime('%%Y-%%m-%%d'))]
# Current week:
domain="[('some_date_time', '>=', (context_today()-datetime.timedelta(days=context_today().weekday())).strftime('%%Y-%%m-%%d')),('start_time', '<=', (context_today()-datetime.timedelta(days=context_today().weekday())+ datetime.timedelta(days=6)).strftime('%%Y-%%m-%%d'))]
# Current year:
domain="[('some_date_time', '>=', (datetime.date(datetime.date.today().year, 1, 1)).strftime('%%Y-%%m-%%d')),('start_time', '<=', (datetime.date(datetime.date.today().year, 12, 31)).strftime('%%Y-%%m-%%d'))]
#in python:
yesterday = datetime.datetime.now() - datetime.timedelta(days = 2)
/**
* PHP version 5
* @package AzulPaymentGateway
* @author ideologic SRL <[email protected]>
* @since File available since Release 1
*/
<?php namespace App;
use Illuminate\Database\Eloquent\Model;
use DB;