Skip to content

Instantly share code, notes, and snippets.

View clint74's full-sized avatar

André Duarte clint74

  • Clint Tecnologia
  • Brazil
View GitHub Profile
{% 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/vue@2.5.13/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-resource@1.3.5"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
from django import forms
from advertisement.models import Advertisement, Category
class AdvertisementForm(forms.ModelForm):
class Meta:
model = Advertisement
fields = [
'title',
@clint74
clint74 / models.py
Last active May 17, 2018 23:53 — forked from djwesleyborges/models.py
Teste
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)
#!/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
@clint74
clint74 / add_utf8_withBOM.py
Last active March 2, 2016 16:08
this script is used to automate the task of transform cordova plugin files into utf-8 (BOM - byte order mark)
"""
#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
@clint74
clint74 / bonfire-dna-pairing.js
Created November 25, 2015 20:41
http://www.freecodecamp.com/clint74 's solution for Bonfire: DNA Pairing Using functional aproach.
// 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){