Skip to content

Instantly share code, notes, and snippets.

View jaitjacob's full-sized avatar
🏖️
chilling

jait jaitjacob

🏖️
chilling
View GitHub Profile
#Program : A tool for downloading Requesting for Comments (RFC) documents #from IETF, and then display them on screen.
#Author : Jait Jacob
#Date : 07/04/2017
import sys,urllib.request
try:
rfc_number=int(sys.argv[1])
except(IndexError, ValueError): #incase you don't pass a RFC number or you #pass an invalid RFC number this error is called upon
print('RFC number not supplied')
import argparse, socket
from datetime import datetime
MAX_BYTES = 65535
def server(port):
sock = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
sock.bind(('127.0.0.1',port))
print('Listening at {}'.format(sock.getsockname()))
while True:
import 'package:flutter/material.dart';
import 'dart:math' as math;
import 'dart:async';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
@jaitjacob
jaitjacob / Eloquent Javascript - Chaper 2 - Excercise 2.2 - FizzBuzz - Solution.js
Created August 3, 2022 23:52
Eloquent Javascript - Chaper 2 - Excercise 2.2 - FizzBuzz - Solution
let counter = 1;
while(counter<=100){
if(counter%3===0 && counter%5===0) console.log("FizzBuzz");
if(counter%3===0) console.log("Fizz");
if(counter%5===0) console.log("Buzz");
console.log(counter);
counter++;
}
@jaitjacob
jaitjacob / Eloquent Javascript - Chaper 2 - Excercise 2.3 - Chessboard - Solution.js
Created August 4, 2022 00:25
Eloquent Javascript - Chaper 2 - Excercise 2.3 - Chessboard - Solution
let size = 8;
let toggle = " ";
let rowString = "";
for(i=0;i<size;i++){
for(j=0;j<size;j++){
rowString = rowString + toggle;
toggle = (toggle===" ")?"#":" ";
}
console.log(rowString);
toggle = (toggle===" ")?"#":" ";
switch (p->peek().type) {
...
...
...
case token_type::reserved_keyword_with_escape_sequence: {
token es = p->peek();
for (const source_code_span &escape_sequence :
*es.identifier_escape_sequences) {
printf("%s", escape_sequence.string_view().data());
}
@jaitjacob
jaitjacob / Indentity.js
Created June 6, 2023 07:50
Identity of an Object in JS
//Concept: Object Identity
//Analogy: Quantum Entanglement of two Objects
particle_a = {
state: 'equilibrium'
};
particle_b = particle_a; //both particles are entangled
//Imagine vast seperation between particle 'a' & 'b'. I'm talking lots of lines of statements.
@jaitjacob
jaitjacob / notes.md
Last active January 31, 2024 17:10
resize images according to your liking within issues, comments on Github

This works on Readme.md, comments within Issues. Pretty much everywhere on GitHub.

  1. Upload the picture by drag-and-drop in the text field.

  2. Github will generate a unique link to the image resource which would look like, ![image](https://image_just_uploaded_via_drag_and_drop)

  3. Replace that with <img src="https://image_just_uploaded_via_drag_and_drop" width="xxx" height="yyy">

  1. add a plant: ZZ plant

  2. go to ZZ plant detail page => add reminders => set title & future time: utc timestamp 19JUL17:30:00 (seen: false by default, status: pending by default) => sent to backend as unix timestamp

  3. GET /plant/reminders 1. get all reminders timestamp < currentUTCtimestamp 2. set status to 'expired'

  4. get all reminders timestamp