Skip to content

Instantly share code, notes, and snippets.

View Adwaith-Rajesh's full-sized avatar
:octocat:
Coding for fun.

Adwaith Rajesh Adwaith-Rajesh

:octocat:
Coding for fun.
View GitHub Profile
@Softwave
Softwave / README.md
Last active June 23, 2024 13:05
Fibonacci Program

Fib

Simple fibonacci number calculator.

Usage: fib nth Fibonacci number

@Apocryphon-X
Apocryphon-X / Reflection-Module.md
Last active May 31, 2024 17:08
Handy V module to simplify the use of compile-time reflection.

Quickstart

Functions available in this module:

  - reflection.(*)_of_type[foo]()  // Extract details from type or struct
  - reflection.(*)_of(bar)         // Extract details from type instance 
  
(*) can be `methods`, `fields` or `attributes`.

Each function returns a map[string]T where T can be FunctionData, FieldData or StructAttribute respectively.

@Adwaith-Rajesh
Adwaith-Rajesh / file.md
Created June 11, 2021 14:18
Issues with activating a virtual env from a python file.

Spoiler alert, you cannot activate a venv from a python file.

Through out this post we will discuss on how venv works, why you cannot activate a venv from python.

How does a venv work or gets activated.

Let's first go through a code snippet here.

@echo off
@RuolinZheng08
RuolinZheng08 / backtracking_template.py
Last active June 6, 2024 22:47
[Algo] Backtracking Template & N-Queens Solution
def is_valid_state(state):
# check if it is a valid solution
return True
def get_candidates(state):
return []
def search(state, solutions):
if is_valid_state(state):
solutions.append(state.copy())
@dmontagu
dmontagu / app.py
Created February 18, 2020 00:28
FastAPI + dash
# Based on the example from https://www.activestate.com/blog/dash-vs-bokeh/
import dash
import dash_core_components as dcc
import dash_html_components as html
import pandas as pd
import plotly.graph_objs as obj
import uvicorn as uvicorn
from dash.dependencies import Input, Output
from fastapi import FastAPI
from starlette.middleware.wsgi import WSGIMiddleware
@ul
ul / list.zig
Created September 16, 2019 07:42
const std = @import("std");
const mem = std.mem;
fn LinkedList(comptime T: type) type {
const Self = struct {
const Node = struct {
next: ?*Node,
data: T,
};
@cferdinandi
cferdinandi / terminal-cheat-sheet.txt
Last active June 19, 2024 03:05
Terminal Cheat Sheet
# Terminal Cheat Sheet
pwd # print working directory
ls # list files in directory
cd # change directory
~ # home directory
.. # up one directory
- # previous working directory
help # get help
-h # get help
@rxaviers
rxaviers / gist:7360908
Last active June 29, 2024 18:36
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: