This file contains 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.forms import ModelForm | |
from .models import Bin | |
from cloudinary.forms import CloudinaryFileField, CloudinaryJsFileField | |
class ServerUploadBinForm(ModelForm): | |
class Meta: | |
model = Bin | |
# To add some options, tags, transformations to your cloudinary image upload | |
class ServerUploadBinFormWithOptions(ModelForm): |
This file contains 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 __future__ import print_function, unicode_literals | |
from PyInquirer import style_from_dict, Token, prompt, Separator | |
from pprint import pprint | |
style = style_from_dict({ | |
Token.Separator: '#cc5454', | |
Token.QuestionMark: '#673ab7 bold', |
This file contains 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
const axios = require('axios'); | |
const express = require('express'); | |
const app = express(); | |
const PORT = process.env.PORT || 5000; | |
const path = require('path'); | |
const handlebars = require('express-handlebars'); | |
app.engine('.hbs', handlebars({ extname: '.hbs' })); |
This file contains 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
app.get('/', function (req, res) { | |
let url = `https://indreed.herokuapp.com/api/jobs?q=web+developer&limit=50`; | |
axios({ | |
method: 'get', | |
url | |
}) | |
.then(function (response) { | |
let jobs = response.data; | |
res.render("index", { title: "Jobby", jobs: jobs}); | |
}) |
This file contains 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
app.get('/search', function (req, res) { | |
queries = req.query; | |
let url = `https://indreed.herokuapp.com/api/jobs`; | |
if (queries){ | |
axios.get(url, { | |
params: queries | |
}) | |
.then(function(response){ | |
res.render("search", { title: "Jobby", jobs: response.data}); | |
}) |
This file contains 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
body.index .search-ribbon { | |
width: 100%; | |
background-color: #ffffff; | |
-webkit-flex-shrink: 0; | |
-ms-flex-negative: 0; | |
flex-shrink: 0; | |
padding: 20px 30px; | |
box-sizing: border-box; | |
height: 75.2vh; | |
} |
This file contains 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
const axios = require('axios'); | |
const express = require('express'); | |
const app = express(); | |
const PORT = process.env.PORT || 5000; | |
const path = require('path'); | |
const handlebars = require('express-handlebars'); | |
app.engine('.hbs', handlebars({ extname: '.hbs' })); |
This file contains 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
const expressip = require('express-ip'); | |
app.use(expressip().getIpInfoMiddleware); // registering the middleware | |
app.get('/search', function (req, res) { | |
const queries = req.query; | |
var ipInfo = req.ipInfo | |
if (ipInfo.country) | |
let url = `https://indreed.herokuapp.com/api/jobs?country=${ipInfo.country}`; | |
else | |
let url = `https://indreed.herokuapp.com/api/jobs`; |
This file contains 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
<link rel="stylesheet" href="https://rawgit.com/MEYVN-digital/mdl-selectfield/master/mdl-selectfield.min.css"> | |
<button id="show-dialog" type="button" class="mdl-button">Show Dialog</button> | |
<dialog class="mdl-dialog"> | |
<h4 class="mdl-dialog__title">Advanced search</h4> | |
<form class="" method="GET"> | |
<div class="mdl-dialog__content"> | |
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label"> | |
<input class="mdl-textfield__input query-input" type="text" id="q" name="q"> | |
<label class="mdl-textfield__label" for="q">Job</label> | |
</div> |
This file contains 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
const express = require('express'); | |
const app = express(); | |
const expressip = require('express-ip'); | |
const PORT = process.env.PORT || 5000; | |
const path = require('path'); | |
app.use(expressip().getIpInfoMiddleware); | |
app.set("PORT", PORT); |