Skip to content

Instantly share code, notes, and snippets.

View olivx's full-sized avatar

Thiago Oliveira olivx

  • Tivit
  • Sao Paulo
View GitHub Profile
@olivx
olivx / switch.html
Last active May 22, 2018 22:41
switch_button
<label class="switch">
<input type="checkbox" class="switch_btn" name="apply_cv_no_file" data-btn="apply_no_cv_btn" checked >
<span class="slider round"></span>
</label>
@olivx
olivx / comandos-docker
Created May 20, 2018 02:36 — forked from geiltonxavier/comandos-docker
Comandos do Docker
Segue a lista de comandos docker e sua utilidade:
docker attach – Acessar dentro do container e trabalhar a partir dele.
docker build – A partir de instruções de um arquivo Dockerfile eu possa criar uma imagem.
docker commit – Cria uma imagem a partir de um container.
docker cp – Copia arquivos ou diretórios do container para o host.
docker create – Cria um novo container.
docker diff – Exibe as alterações feitas no filesystem do container.
docker events – Exibe os eventos do container em tempo real.
docker exec – Executa uma instrução dentro do container que está rodando sem precisar atachar nele.
@olivx
olivx / style.css
Created May 23, 2018 14:00
css utils
.boxfilters {
padding:13px 20px;
background-color:#fff;
border:1px #ddd solid;
max-height:150px;
overflow: auto;
margin-bottom:10px;
}
.badge-unemp {
background-color: rgba(247, 226, 197, 0.49);
@olivx
olivx / cropper.min.css
Created June 15, 2018 17:17
Crop Image user profile django & jquery
/*!
* Cropper v3.0.0-beta
* https://github.com/fengyuanchen/cropper
*
* Copyright (c) 2017 Fengyuan Chen
* Released under the MIT license
*
* Date: 2017-02-25T07:44:44.656Z
*/
@olivx
olivx / change_select_feed.js
Created July 27, 2018 19:08
Feed when change the value
$('#id_job_department').change(function(event) {
var department_pk = $(this).val()
url = "{% url 'json_sub_department' %}"
if ($(this).children('option:first-child').is(':selected')) {
$('#id_job_sub_department').children('option:not(:first)').remove();
}else{
$.ajax({
dataType:'json',
data: {'pk': department_pk},
@olivx
olivx / responsivel_table.css
Created July 28, 2018 14:47
responsivel table
/*
Max width before this PARTICULAR table gets nasty. This query will take effect for any screen smaller than 760px and also iPads specifically.
*/
@media
only screen
and (max-width: 760px), (min-device-width: 768px)
and (max-device-width: 1024px) {
/* Force table to not be like tables anymore */
table, thead, tbody, th, td, tr {
@olivx
olivx / decorator_protect_views.py
Created August 4, 2018 00:06
protect acess url views
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.decorators import user_passes_test
from account.models import Profile
def client_user_denied(function=None, redirect_field_name=REDIRECT_FIELD_NAME, login_url='account:login'):
actual_decorator = user_passes_test(
lambda u: u.is_active and u.profile.type > 0,
login_url=login_url, redirect_field_name=redirect_field_name
)
// Bootstrap datepicker
$('.input-daterange input').each(function() {
$(this).datepicker('clearDates');
});
// Set up your table
table = $('#my-table').DataTable({
paging: false,
info: false
});
@import "https://fonts.googleapis.com/css?family=Dosis:300,400,500,600,700";
#timeline .timeline-item:after, #timeline .timeline-item:before {
content: '';
display: block;
width: 100%;
clear: both;
}
*, *:before, *:after {
box-sizing: border-box;
-webkit-box-sizing: border-box;
import time
from datetime import datetime , timedelta
from dateutil.rrule import rrule, MONTHLY, DAILY
date_start_obj = datetime(2018,05,18)
date_end_obj = datetime(2018,05,30)
# holidays = [datetime(2018,05,21).date(), datetime(2018,05,28).date(), datetime(2018,05,20).date()]
def get_working_days(date_start_obj, date_end_obj, holidays=[]):
many_holidays = 0