This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@admin.register(OS) | |
class AdminOS(DjangoObjectActions, AdminBaseModel): | |
list_display = ['__str__', 'situacao', # 'cliente', | |
'produto', 'nr_projeto', 'tempo', 'descricao', 'updated'] | |
search_fields = ['nr_os', 'nr_projeto', 'descricao'] | |
list_filter = ['situacao', 'produto__cliente__nome'] | |
readonly_fields_on_update = ['created_by', 'updated'] # , 'cliente' | |
fields = (('data_abertura', 'solicitante'), # , 'cliente' | |
('produto', 'nr_projeto'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export GIT_PS1_SHOWDIRTYSTATE=1 | |
export GIT_PS1_SHOWSTASHSTATE=1 | |
export GIT_PS1_SHOWUPSTREAM="auto" | |
PS1='\[\033[0;32m\]\[\033[0m\033[0;32m\]\u\[\033[0;36m\]@\[\033[0;36m\]\h \w\[\033[0;32m\]$(__git_ps1)\n\[\033[0;32m\]└─\[\033[0m\033[0;32m\] \$\[\033[0m\033[0;32m\] ▶\[\033[0m\] ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function permutations($pool, $r = null) { | |
$n = count($pool); | |
if ($r == null) { | |
$r = $n; | |
} | |
if ($r > $n) { | |
return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# With this tool you can delete files using a mask, but keeping some files | |
# I've wrote this tool to house keep log files | |
# Usage: bash delete_old.sh <number of files to keep> "folder/mask" | |
# If you use mask like * or ? in your command, add quotes to prevent enumeration | |
keep=$(($1)) | |
folder=${2:-...} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The MIT License (MIT) | |
# Copyright (c) 2016 Vladimir Ignatev | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining | |
# a copy of this software and associated documentation files (the "Software"), | |
# to deal in the Software without restriction, including without limitation | |
# the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
# and/or sell copies of the Software, and to permit persons to whom the Software | |
# is furnished to do so, subject to the following conditions: | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections.abc import Iterable | |
class BusList(list): | |
""" Bus (FIFO) list | |
""" | |
def __init__(self, *args): | |
self._max_length = 0 | |
for arg in args: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Singleton | |
class DBConnection(object): | |
def __init__(self): | |
"""Initialize your database connection here.""" | |
pass | |
def __str__(self): | |
return 'Database connection object' | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
case $- in | |
*i*) ;; | |
*) return;; | |
esac |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python | |
n1=int(input("digite numero :")) | |
n2=int(input("digite numero :")) | |
oper=input("digite soma = +,subtração = -,multiplicação = *,divisao = /:") | |
#soma | |
if (oper=="+"): | |
print("resultado = ",n1+n2) |
NewerOlder