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
// Bonfire: DNA Pairing | |
// Author: @clint74 | |
// Challenge: http://www.freecodecamp.com/challenges/bonfire-dna-pairing | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function pair(str) { | |
var get_pair = {"A": "T", "T": "A", "C":"G", "G":"C" }; | |
var map = Array.prototype.map; | |
var dna_chain = map.call(str, function(elem){ |
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
""" | |
#C:\dev\phonegap\ | |
this script is used to automate the task of transform | |
cordova plugin files into utf-8 (BOM - byte order mark) | |
* This is specfic to cordova platform windows | |
**Windows App Certification Kit complains about encoding of files :-( | |
and does not allow to public your app on Windows Store until | |
every file was ok. | |
""" | |
import os |
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/sh | |
#remove migrations files if you are in projectroot/scripts | |
find .. -path "*/migrations/*.py" -not -name "__init__.py" -delete | |
find .. -path "*/migrations/*.pyc" -delete | |
#delete records from migrations table | |
psql -d mydatabase -c 'delete from django_migrations;' | |
#create migrations again |
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 django.contrib.auth.models import User | |
from django.db import models | |
# Model cadastro de produto | |
class Advertisement(models.Model): | |
title = models.CharField(max_length=100) | |
address = models.CharField(max_length=100) | |
complement = models.CharField(max_length=100) |
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 django import forms | |
from advertisement.models import Advertisement, Category | |
class AdvertisementForm(forms.ModelForm): | |
class Meta: | |
model = Advertisement | |
fields = [ | |
'title', |
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
{% load staticfiles %} | |
<script type="text/javascript" src="{% static 'js/jquery-3.3.1.slim.min.js' %}"></script> | |
<script type="text/javascript" src="{% static 'js/popper.min.js' %}"></script> | |
<script type="text/javascript" src="{% static 'js/bootstrap.min.js' %}"></script> | |
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script> | |
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script> | |
<script src="https://unpkg.com/axios/dist/axios.min.js"></script> |
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
#!/home/andre/.virtualenvs/myproject/bin/python | |
import os | |
import sys | |
DEBUG = False | |
#DEBUG = True | |
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
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
<template> | |
<q-page> | |
<q-input | |
float-label="CNPJ/CPF BR" | |
v-mask="['###.###.###-##', '##.###.###/####-##']" | |
placeholder="only numbers" | |
v-model="form.cpfCnpj" | |
</q-input> | |
</q-page> | |
</template> |
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 django.http import HttpResponse, HttpResponseRedirect | |
from django.contrib.auth import authenticate, login | |
def login(request): | |
if request.POST: | |
username = request.POST['username'] | |
password = request.POST['password'] | |
user = authenticate(username=username, password=password) | |
if user is not None: |
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
import platform | |
import requests | |
from time import sleep | |
import os | |
import sys | |
from contextlib import contextmanager | |
from os import mkdir, getcwd | |
from selenium import webdriver | |
from PIL import Image | |
from selenium.webdriver.chrome.options import Options |
OlderNewer