Skip to content

Instantly share code, notes, and snippets.

Avatar

Madhusoodan Pataki mmpataki

View GitHub Profile
View Configuration.java
@Retention(RetentionPolicy.RUNTIME)
public @interface Exposed {
String value();
}
@Retention(RetentionPolicy.RUNTIME)
public @interface Argument {
String[] keys();
View timeserver-java-streams.java
package com.example;
import java.io.IOException;
import java.net.ServerSocket;
import java.util.Date;
import java.util.stream.LongStream;
public class TimeServer {
public static void main(String[] args) throws IOException {
View ia4jgen.js
// ==UserScript==
// @name ia4jgen
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Generate ia4j snippets from the opengrok
// @author Madhusoodan
// @match http://psvglapp01:8080/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==
@mmpataki
mmpataki / Dish.java
Last active Jul 28, 2021
Updateable Mongo Store
View Dish.java
/*
* Model to be stored
*/
public class Dish extends Updateable {
String name;
String originCountry;
String recipe;
public Dish(String name, String originCountry, String recipe) {
View tabs.html
<html>
<style>
.tabh1 + label, .tabh2 + label, .tabh3 + label { padding: 2px 8px; border: solid 1px lightgray; display: inline-block; border-bottom: none; }
.tabh1:checked + label, .tabh2:checked + label, .tabh3:checked + label { background: olivedrab; }
.tabh1, .tabh2, .tabh3 { display: none;}
.tabc1, .tabc2, .tabc3 { display: none; padding: 20px; border: solid 1px lightgray;}
.tabh1:checked ~ .tabc1, .tabh2:checked ~ .tabc2, .tabh3:checked ~ .tabc3 { display: block; }
</style>
<div>
<input id='th1' type='radio' name='tswitcher' class='tabh1' checked></input>
View AadharDetailsStory.js
class AadharDetailsStory {
constructor(args) { this.args = args; }
title() { return "Enter your Aadhar ID" }
moral() { return { ...this.args, aadharid: this.aadharid.value } }
async isCompleted() { return this.aadharid.value && this.aadharid.value.length == 12 }
getQuestions() { return "Enter a valid aadhar id" }
nextStoryName() { return OTPVerifyStory }
preDestroy() { this.status.innerText = 'validating aadhar details...'; return new Promise(res => setTimeout(() => res(), 1000)) }
tell() {
return render('aadhar', {
View render.js
function render(name, spec, elemCreated, container) {
let e;
if (!spec.preBuilt) {
e = document.createElement(spec.ele);
spec.iden && elemCreated(spec.iden, e)
if (spec.text) e.innerHTML = spec.text;
if (spec.classList) {
e.classList = `${name}-` + spec.classList.split(/\s+/).join(` ${name}-`)
}
spec.attribs && Object.keys(spec.attribs).forEach(key => {
View storyteller.html
<html>
<body>
<style>
.storyboard-content { padding: 10px; }
.storyboard-titlebar { padding: 10px 0px; }
.storyboard-errmsg { color: red; }
.storyboard-title { font-weight: bolder; font-size: 1.1em; }
input, select { display: block; margin: 5px 10px; padding: 5px; min-width: 200px; }
button { padding: 5px 10px; margin-right: 10px; }
@mmpataki
mmpataki / test.ipynb
Last active Jan 4, 2021
a ipynb test
View test.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View novpn.py
import signal
import subprocess
from fbchat import Client
from fbchat.models import *
user = "F1_user_email"
passwd = "F1_user_password"
recvFrom = "F2_user_id"
client = None