Skip to content

Instantly share code, notes, and snippets.

View Allwin12's full-sized avatar

Allwin Raju Allwin12

  • Genesys
  • chennai
View GitHub Profile
author = Author.objects.get(pk=author.pk)
reporter.refresh_from_db()
from django.db.models import F
Post.objects.filter(number_of_comments__gt=F('number_of_likes'))
@Allwin12
Allwin12 / matrixtranspose.py
Created November 18, 2019 07:01
Transpose of a matrix
li = [(1,2,3),(4,5,6),(7,8,9)}
print(list(zip(*li))) #[(1, 4, 7), (2, 5, 8), (3, 6, 9)]
plugins:
- jekyll-sitemap
@Allwin12
Allwin12 / requirements.txt
Created November 20, 2019 19:22
requirements file
Django==2.2.5
django-rest-framework==0.1.0
djangorestframework==3.10.3
pytz==2019.2
sqlparse==0.3.0
@Allwin12
Allwin12 / image_iterator.py
Created December 3, 2019 06:44
This python gist will open the images in a given directory one by one and will close the image after 5 seconds
import time
import psutil
import os
from PIL import Image
directory = '/home/allwin/Pictures/Wallpapers/'
files = os.listdir(directory)
for file in files:
.widget-content.popular-posts
{
font-family:Josefin Sans, serif;
font-size:16px;
background: #cae4ff ;
padding:10px;
box-shadow: 10px 10px 5px grey;
}
#Stats1.widget.Stats
@Allwin12
Allwin12 / send_mail.js
Created December 3, 2019 11:38
send email using nodejs and nodemailer
var nodemailer = require('nodemailer');
var transporter = nodemailer.createTransport({
service: 'gmail',
auth: {
user: 'mailtoallwinraju@gmail.com',
pass: '****'
}
});
@Allwin12
Allwin12 / imageZoomOnHover.html
Created December 4, 2019 08:47
Magnifies the image on hover
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
* {
box-sizing: border-box;
}
.zoom {
<div class="fixed-header">
<table>
<tr>
<td>
<img src="https://drive.google.com/uc?id=1MVegkTrs0UVDQ_DrSvvwpq6dknsuC_xW" height="50px" width="50px" >
</td>
<td>
<h1 style="font-size:50px;">CodeSimple</h1>
</td>
</tr>