Skip to content

Instantly share code, notes, and snippets.

{data:{CPC01:[1234567,5321156667]}}
@vmwsree
vmwsree / Enum
Last active November 11, 2019 08:38
# -*- coding: utf-8 -*-
# @Author: Vivek Mohan
# @Date: 2019-11-03 16:23:13
# @Last Modified by: Vivek Mohan
# @Last Modified time: 2019-11-04 16:00:25
#!/usr/bin/env python
import signal
import time
import sys
import os
@vmwsree
vmwsree / image-opt.py
Created July 8, 2019 12:30
Aws bucket Meeting Room Images
from nitwit.website.models import *
from sorl.thumbnail import get_thumbnail
from sorl.thumbnail import delete
x= MeetingRoom.objects.all()
z= MeetingRoomImages.objects.all()
for y in z:
im = get_thumbnail(y.picture, '150x210', crop='center', quality=99)
y.picture_thumb=im.url
y.save()

dart

new Container(
  child: new OverflowBox(
    minWidth: 0.0, 
    minHeight: 0.0, 
    maxWidth: double.INFINITY, 
    child: new Image(
      image: new AssetImage('assets/images/bubbles.jpg'), 
 fit: BoxFit.cover)) 
new AppBar(
          elevation: _appBarElevation,
          backgroundColor: theme.appBarBackgroundColor,
          iconTheme: Theme.of(context).iconTheme,
          brightness: Brightness.light,
          flexibleSpace: new Container(
              decoration: new BoxDecoration(
                  border: new Border(
                      bottom: new BorderSide(color: theme.dividerColor)))),
class HeroImage(ImageMixin):
    image = VersatileImageField(upload_to=upload_to, ppoi_field='image_poi',
                                verbose_name="image")
    image_poi = PPOIField(verbose_name="image's Point of Interest")  # point of interest
    caption = models.CharField(max_length=250, blank=True)
@vmwsree
vmwsree / flutter_cheatsheet.md
Last active February 28, 2021 10:31
Cheat Sheet For Flutter

Container to be full width

constraints: BoxConstraints.expand() so the child a column can have expanded

Outlined Text Box

TextField(
  controller: _usernameController,
  decoration: InputDecoration(
sudo nmap -sP 172.168.0-255.0-255 |awk '/^Nmap/{ipaddress=$NF}/B8:27:EB/{print ipaddress}'
r
Opens a file for reading only. The file pointer is placed at the beginning of the file. This is the default mode.
rb
Opens a file for reading only in binary format. The file pointer is placed at the beginning of the file. This is the default mode.
r+
Opens a file for both reading and writing. The file pointer will be at the beginning of the file.
rb+
@vmwsree
vmwsree / psql-prod
Last active February 19, 2018 23:45
sudo su - postgres
\password Change your password
\q Exit psql
\l List all databases accessible by the current account
\du List roles
\c <db name> Connect to a database
\dt List all tables in a connected database
\d <table> List columns in the selected table
\conninfo Show information about your currect connection