Skip to content

Instantly share code, notes, and snippets.

View lokeshpahal's full-sized avatar
🏠
Working from home

Lokesh Pahal lokeshpahal

🏠
Working from home
  • Code Genesys
  • Delhi
View GitHub Profile
import 'dart:math';
import 'package:flutter/material.dart';
class StickyNote extends StatelessWidget {
const StickyNote({
super.key,
required this.child,
this.color = const Color(0xffffff00),
});
import 'dart:collection';
import 'package:flutter/material.dart';
import 'package:abc/ui/appbar/common.dart';
import 'package:abc/ui/pages/stem/sticky.dart';
import 'package:abc/ui/widgets/custom.dart';
class Item {
final String id;
String listId;
final String title;
@lokeshpahal
lokeshpahal / docker-for-mac.md
Created December 16, 2022 16:34 — forked from BretFisher/docker-for-mac.md
Getting a Shell in the Docker Desktop Mac VM

2021 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Docker VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1


@lokeshpahal
lokeshpahal / index.html
Created November 16, 2022 14:13 — forked from jdarling/index.html
Reuseable D3 MindMap (left/right tree)
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<script type="text/javascript" src="http://d3js.org/d3.v3.min.js"></script>
<style type="text/css">
.node circle {
cursor: pointer;
fill: #fff;
stroke: steelblue;
@lokeshpahal
lokeshpahal / encoding-video.md
Created August 31, 2021 05:30 — forked from glen-cheney/encoding-video.md
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@lokeshpahal
lokeshpahal / Email Server (Linux, Unix, Mac).md
Created May 6, 2020 06:33 — forked from raelgc/Email Server (Linux, Unix, Mac).md
Setup a Local Only SMTP Email Server (Linux, Unix, Mac)

Setup a Local Only SMTP Email Server (Linux, Unix, Mac)

1 - Point localhost.com to your machine

Most of programs will not accept an email using just @localhost as domain. So, edit /etc/hosts file to make the domain localhost.com point to your machine, including this content to the file:

127.0.0.1 localhost.com

2 - Install Postfix

@lokeshpahal
lokeshpahal / unlimited_trials_babeledit.txt
Created February 20, 2020 14:08
Activate BabelEdit temporarily / Unlimited trial
Obviously for educative purposes only.
Furthermore, this DOESN'T activate BabelEdit permanently.
If you like the software, buy it, the devs deserve it.
Since I have no money to buy it, I discovered a workaround for unlimited trials.
It's quite a annoying workaround, but ... it works!
Firstly go to "c:\windows\system32\drivers\etc\" and open the "hosts" file in Notepad/Notepad++/VSCode/Sublime/Atom/whatever as admin (if you don't open it as admin, it won't let you save it).
Add this line at the end of the file:
@lokeshpahal
lokeshpahal / A slack_logger.py
Created February 21, 2019 06:35 — forked from DominikSerafin/01_info
Django Slack Logger
import requests
import json
import time
import math
from copy import copy
from django.conf import settings
from django.utils.log import AdminEmailHandler
from django.views.debug import ExceptionReporter
class SlackExceptionHandler(AdminEmailHandler):
@lokeshpahal
lokeshpahal / debug_queries.py
Created January 24, 2019 18:49
Django 2.0 Debug DB queries performance (execution time) and total no of queries executed.
from django.db import connection
from django.utils.deprecation import MiddlewareMixin
import logging
logger = logging.getLogger(__name__)
class QueryCountDebugMiddleware(MiddlewareMixin):
"""
This middleware will log the number of queries run
@lokeshpahal
lokeshpahal / Dockerfile
Created December 24, 2018 17:01
Dockerfile - Ubuntu 16.04 | Python3.6
# docker build -t ubuntu1604py36
FROM ubuntu:16.04
RUN apt-get update && apt-get install -y software-properties-common vim
RUN add-apt-repository ppa:jonathonf/python-3.6 && apt-get update
RUN apt-get install -y build-essential python3.6 python3.6-dev python3-pip python3.6-venv && \
apt-get install -y libmysqlclient-dev curl git libxml2 libxml2-dev libxslt1-dev libfreetype6-dev
RUN apt-get install -y libcurl4-openssl-dev libssl-dev
# update pip