Skip to content

Instantly share code, notes, and snippets.

@ramyak-mehra
ramyak-mehra / gsoc.md
Last active November 27, 2022 14:30
Google Summer of Code - Extend aarch64 support in rust-vmm/vmm-reference

GSoC '22 - Extend aarch64 support in rust-vmm/vmm-reference

Project Overview

The initial goal of the project was to extend aarch64 support in rust-vmm/vmm-reference. Earlier it had support for x86_64 and proof-of-concept support for aarch64. The goal was to bring it par with x86_64. Some of the tasks that needed to be done as part of the project were:

  • Set up an interrupt controller.
  • Add a real-time clock device.
  • Add a serial port.
  • Add a flattened device tree (FDT) so guest has a machine description.
    *(Not all of them are mentioned here and some of them were resolved before I picked up the tasks, but I still had plenty to do).
"""Represents a Pokémon's attack types"""
type Attack {
"""The name of this Pokémon attack"""
name: String
"""The type of this Pokémon attack"""
type: String
"""The damage of this Pokémon attack"""
damage: Int
Future<FetchPokemons$Query> _fetchArtemisClient(ArtemisClient client) async {
final pokemonsQuery =
FetchPokemonsQuery(variables: FetchPokemonsArguments(quantity: 15));
final result = await client.execute(pokemonsQuery);
if (result.hasErrors) {
throw Exception(result.errors);
}
return result.data!;
}
//If you are using something like graphql for client you can do something like this.
class Home extends StatelessWidget {
final ArtemisClient artemisClient;
const Home({Key? key, required this.artemisClient}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
appBar: AppBar(
@ramyak-mehra
ramyak-mehra / markdown_parser.dart
Last active April 25, 2021 00:22
Parse a markdown and divide it into sections
import 'package:markdown/markdown.dart';
import 'dart:io' as io;
final _structuralHeaderTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
class Section {
int level;
Node titleNode;
List<Node> contentNodes;
List<Section> children;
import 'dart:io' as io;
import 'package:yaml/yaml.dart';
import 'dart:convert';
import 'package:http/http.dart' as http;
void main(List<String> args) async {
final httpClient = http.Client();
var results = [];
final listPackages = getPackages();
@ramyak-mehra
ramyak-mehra / pubspecvalidate.dart
Created March 23, 2021 21:15
Script to validate dart packages pubspec yaml that can it be converted to json or not
import 'dart:convert';
import 'package:yaml/yaml.dart';
import 'dart:io';
import 'package:tar/tar.dart';
import 'package:http/http.dart' as http;
void main(List<String> args) async {
final httpClient = http.Client();
var packageUrl = '';
var pubspecContent;
class Section {
int level;
Element titleNode;
List<Node> contentNodes;
List<Section> subSections;
void _addContentNodes(Node nodes) {
contentNodes = List.from(contentNodes)..add(nodes);
}
import socket
def main():
host = '192.168.1.33'
port = 5000
s = socket.socket()
s.bind((host,port))
@ramyak-mehra
ramyak-mehra / Graphql Tips
Created August 13, 2020 08:12
Its about Graphql Tips
1. Use fragments for avoiding boiler plate code
{
leftComparison: hero(episode: EMPIRE) {
...comparisonFields
}
rightComparison: hero(episode: JEDI) {
...comparisonFields
}
}