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
# This is a fork from Levelsio's gist. | |
# Check the original gist (PHP) https://gist.github.com/levelsio/6716e7261c73fd873ba2ce1f4a406012 | |
# I just converted it so it can be used with Django. | |
# This is all Python3.6 | |
# // <readme> | |
# /* | |
# This is a lite version of Olark's and Intercom's functionality (without the chat part). | |
# It lets you get feedback from users on your site to your email. | |
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 unicode_literals | |
from django.db import models | |
from django.utils import timezone | |
# CREATE MODELS HERE | |
class RSSJFeed(models.Model): | |
id = models.AutoField(primary_key=True) | |
time = models.DateTimeField(default=timezone.now) | |
title = models.CharField(max_length=60) |
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.shortcuts import render | |
from django.http import HttpResponse, JsonResponse, HttpResponseRedirect | |
from pullrss.models import RSSData | |
import feedparser | |
from django.db import IntegrityError | |
from time import mktime | |
from datetime import datetime | |
from django.shortcuts import render_to_response | |
from django.template import RequestContext |
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
[Unit] | |
Description=bot | |
After=network.target | |
[Service] | |
User=username | |
Type=idle | |
ExecStart=/home/user/bots/venv/bin/python3.6 /home/user/bots/botscript.py | |
[Install] |
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
USING JSON WITH JAVASCRIPT BASICS. | |
CREDIT GOES TO: https://github.com/Fanna1119 | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400" rel="stylesheet"> | |
</head> |
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
import json | |
import io | |
mydata = json.load(io.open('library.json', 'r', encoding='utf-8-sig')) | |
# print(mydata['plist']['dict']['dict']['dict'][1]['string'][0]) | |
a = mydata['plist']['dict']['dict']['dict'] | |
for k in a: | |
data = k['string'] | |
song = data[0] | |
artist = data[1] | |
print(song, ' , ', artist) |
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
//HtML | |
<form> | |
{% csrf_token %} | |
<input type="file" name="pic" accept="image/*" id="image"> | |
<input type="submit" id="send"> | |
</form> | |
//JS |
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
function ResizeImage() { | |
var description = $('#imgdescription').val(); | |
var project_name = $('#project_name').val(); | |
if (window.File && window.FileReader && window.FileList && window.Blob) { | |
var filesToUploads = document.getElementById('imageFile').files; | |
var file = filesToUploads[0]; | |
if (file) { | |
var reader = new FileReader(); | |
// Set the image once loaded into file reader |
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
.bigHeaderFont { | |
font-size: 20em; | |
} | |
@media (max-width:1024px) { | |
.bigHeaderFont { | |
font-size:10em; | |
} |
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
import os | |
import datetime | |
from datetime import datetime | |
from flask import Flask | |
import json | |
from flask import request, url_for | |
from flask_sqlalchemy import SQLAlchemy | |
from flask import jsonify, json, request | |
from flask_cors import CORS | |
from flask_bcrypt import Bcrypt |
OlderNewer