Skip to content

Instantly share code, notes, and snippets.

View pavi2410's full-sized avatar
:octocat:
Githubbing

Pavitra Golchha pavi2410

:octocat:
Githubbing
View GitHub Profile
@pavi2410
pavi2410 / Data Structures in C
Last active August 25, 2021 09:16
Implementation of data structures in C
## Singly Linked List
- new node
- size
- insert at beginning
- insert at end
- insert at position
- delete at beginning
- delete at end
- delete at position
- print list
fn loading() {
colors := [41, 42, 43, 44, 45, 46]
cursor_left := '\e[1000D'
reset := '\e[0m'
pbar := ' '
scale := 2
for i in 0..100+1 {
time.sleep_ms(50)
width := (i+1) / scale
mut bar := ''
file = open("lorem.txt", "r")
text = file.read()
v = 0
c = 0
u = 0
l = 0
for char in text:
class TimeFormatted extends HTMLElement {
render() { // (1)
alert(1)
}
connectedCallback() { // (2)
if (!this.rendered) {
this.render();
@pavi2410
pavi2410 / srm_elab.css
Last active October 1, 2020 11:43
Dark theme for SRM eLab
body { background-color: black; }
.mat-card { filter: invert(0.9); }
#svgChart > g:nth-child(2) > rect:nth-child(1) { fill: black; }
#courseName { color: white; }
.selector { filter: invert(1); position: absolute; top: 83px; left: 30%; }
.top a { visibility: hidden; }
.question { background-color: black; max-height: none !important; padding: 0 !important; overflow: unset !important; }
.solution { width: 68% !important; }
.question a { font-family: "Cascadia Mono"; }
.question pre, .solution pre.ng-star-inserted { padding: 4px; background-color: black; }
// Sets the bit at pos to 1 if 0, else keeps unchanges
void set_bit(int *bits, int pos) {
(*bits) |= (1 << pos);
}
// Clears the bit at pos to 0 if 1, else keeps unchanged
void clear_bit(int *bits, int pos) {
(*bits) &= ~(1 << pos);
}
@pavi2410
pavi2410 / androidstats.ps1
Last active December 22, 2020 12:55
Get Android API Distribution Stats right from PowerShell
Invoke-RestMethod https://dl.google.com/android/studio/metadata/distributions.json | Format-Table name, @{ Label = 'version'; Expression = { $_.version }; Align = 'right' }, apiLevel, @{ Label = 'distribution'; Expression = { "$([math]::Round($_.distributionPercentage * 100, 1))%" }; Align = 'right' }
#include <stdio.h>
#include <string.h>
#include <time.h>
struct Book {
int BookNumber;
char BookTitle[100];
char Author[100];
char Publisher[100];
int YearOfPublication;
@pavi2410
pavi2410 / Replace template
Last active April 22, 2020 17:48
IntelliJ Structural Replace for changing annotation value
@UsesPermissions({
$LList$
})
@pavi2410
pavi2410 / SimpleLabel.java
Created March 30, 2020 15:17
GSOC Proposal for Visible Component Extensions in App Inventor
package test;
import android.view.View;
import android.widget.TextView;
import com.google.appinventor.components.annotations.DesignerComponent;
import com.google.appinventor.components.annotations.SimpleFunction;
import com.google.appinventor.components.annotations.SimpleObject;
import com.google.appinventor.components.common.ComponentCategory;
import com.google.appinventor.components.runtime.AndroidViewComponent;
import com.google.appinventor.components.runtime.ComponentContainer;