Skip to content

Instantly share code, notes, and snippets.

View pratik-chakravorty's full-sized avatar

Pratik Chakravorty pratik-chakravorty

  • Dublin, Ireland
View GitHub Profile
@pratik-chakravorty
pratik-chakravorty / astrovim settings
Last active August 7, 2022 17:28
astrovim settings
local config = {
-- Configure AstroNvim updates
updater = {
remote = "origin", -- remote to use
channel = "nightly", -- "stable" or "nightly"
version = "latest", -- "latest", tag name, or regex search like "v1.*" to only do updates before v2 (STABLE ONLY)
branch = "main", -- branch name (NIGHTLY ONLY)
commit = nil, -- commit hash (NIGHTLY ONLY)
pin_plugins = nil, -- nil, true, false (nil will pin plugins on stable only)
{
"FullStudy": {
"@Rank": "418438",
"Struct": {
"@Name": "Study",
"Struct": [
{
"@Name": "ProtocolSection",
"Struct": [
{
import os
import xml.etree.ElementTree as ET
import json
path = "."
def find_thing(root, field_name, filename=''):
print(f"Filename: {filename}")
return root.find(f".//*[@Name='{field_name}']").text
@pratik-chakravorty
pratik-chakravorty / file_processing.py
Last active January 18, 2022 17:09
File processing
import csv
import os
# Make sure all the snp files are in the same folder where the python file is
snp_files_list = [item for item in os.listdir(os.getcwd()) if item.startswith('snp')]
snp_list = []
const mongoose = require("mongoose");
const Schema = mongoose.Schema;
const postSchema = new Schema({
user: {
type: Schema.Types.ObjectId,
ref: "user"
},
text: {
type: String,
const express = require("express");
const router = express.Router();
const { check, validationResult } = require("express-validator");
const auth = require("../../middleware/auth");
const Post = require("../../models/Post");
const User = require("../../models/User");
//@route POST api/posts
//@desc Create a Post
import { createStore } from "redux";
import rootReducer from "./reducers";
const store = createStore(rootReducer);
export default store;
const initialState = {
isLoading: true,
animes: [],
anime: {}
};
import {
FETCH_ANIME_SUCCESS,
FETCH_ANIME_DETAIL,
FETCH_ANIME_DETAIL_SUCCESS
} from "../actions/constants";
const initialState = {
isLoading: true,
animes: [],
anime: {}
import {
FETCH_ANIME,
FETCH_ANIME_SUCCESS,
FETCH_ANIME_DETAIL,
FETCH_ANIME_DETAIL_SUCCESS
} from "./constants";
export const fetchAnime = () => ({
type: FETCH_ANIME
});