Skip to content

Instantly share code, notes, and snippets.

View Bernix01's full-sized avatar
:shipit:
Working from home

Guillermo Enrique Bernal Moreira Bernix01

:shipit:
Working from home
View GitHub Profile
@Bernix01
Bernix01 / fixme.js
Created November 9, 2020 04:44
Jquery to set an element to fixed while scrolling within its parent div and absolute position it to bottom when parent bottom reached.
(function ($) {
const fixme = $(".fixme");
// all JS code here
let fixmeTop = fixme.offset().top; // get initial position of the element
const parent1 = fixme.parent();
const parent2 = parent1.parent();
let fixmebottom =
parent2.position().top +
parent2.offset().top +
@Bernix01
Bernix01 / pm.py
Created September 6, 2018 23:06
Paymentez Toolbox
import os
import requests
import sys
import pprint
'''
Description:
Allows to list and delete user pm cards using Paymentez API. For development testing purposes only.
Usage:
Make sure you have requests installed with pip install requests.
@Bernix01
Bernix01 / Privacy.md
Created July 10, 2018 21:32
Recetas San Carlos

Privacy Policy

Effective date: July 10, 2018

Recetas San Carlos ("us", "we", or "our") operates the website and the Recetas San Carlos mobile application (the "Service").

This page informs you of our policies regarding the collection, use, and disclosure of personal data when you use our Service and the choices you have associated with that data. This Privacy Policy for Recetas San Carlos is powered by FreePrivacyPolicy.com.

We use your data to provide and improve the Service. By using the Service, you agree to the collection and use of information in accordance with this policy. Unless otherwise defined in this Privacy Policy, terms used in this Privacy Policy have the same meanings as in our Terms and Conditions.

@Bernix01
Bernix01 / log.py
Created January 3, 2018 16:58
drf LogEntry viewset Mixin
'''
Extracted and modified from django-model-logging
It used it's own LogEntry model but since django
has it's own LogEntry maybe someone would want to
register in the same model instead of creating a
new one.
'''
from django.contrib.admin.models import LogEntry, ADDITION, CHANGE, ContentType, DELETION
from django.utils.translation import gettext as _
@Bernix01
Bernix01 / csv-date-reformatter.php
Created November 1, 2017 01:39
CSV date re-formatter
<?php
$data = 'fecha';
$arra = str_getcsv ( $data , "\n" );
foreach($arra as &$Row) {
$Row = str_getcsv($Row, ",");
if($Row[20] != "" && $Row[20] != "fechalect"){
$Row[20] = strftime("%Y-%m-%d %H:%M:%S",strtotime($Row[20]));
}
echo implode (",", $Row)."\n";
@Bernix01
Bernix01 / rename.rb
Created August 29, 2017 22:16
Rename files in s3
# This is a modification of https://gist.github.com/voxxit/6c40a5583a2e3ff51dfa5725c069a830
# This is a quick script for doing a mass rename of all files in an Amazon S3 bucket.
# In this case, the rename operation was to unescape all filenames which had been
# previously escaped in error.
#############################
# Configuration:
bucketname = "the_incredible_bucket"
region = "region"
@Bernix01
Bernix01 / index-admin.php
Last active September 6, 2016 01:50
Ejemplo vista administracion
<?php require_once $_SERVER['DOCUMENT_ROOT'].'/src/autoload.php';
//aquí pueden ir agregando sus colectores usando
use mas_acceso\edificio\Edificio; //por ejemplo.
?>
<!DOCTYPE html>
<html lang='es'>
<head>
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
@Bernix01
Bernix01 / Tarea.md
Last active June 22, 2016 17:24
Tarea Sass

##Tarea

  • Escribir un mixin que permita a cualquier propiedad darle los vendor-prefixes de webkit, opera y mozilla.
@Bernix01
Bernix01 / ejecutar_ejemplo.sh
Last active June 19, 2016 03:53
SASS - PSW
sass style.scss style.css
git clone https://github.com/Bernix01/leccion-git-anticorrupcion.git
cd leccion-git-anticorrupcion
git branch desarrollo
git branch produccion
touch index.htm
nano index.htm #Edita y guarda
git add index.htm
git commit -m "primer commit"