Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Githubbing

Pavitra Golchha pavi2410

:octocat:
Githubbing
View GitHub Profile
View progressbar.v
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 := ''
View counter.py
file = open("lorem.txt", "r")
text = file.read()
v = 0
c = 0
u = 0
l = 0
for char in text:
View time-formatted.js
class TimeFormatted extends HTMLElement {
render() { // (1)
alert(1)
}
connectedCallback() { // (2)
if (!this.rendered) {
this.render();
@pavi2410
pavi2410 / srm_elab.css
Last active Oct 1, 2020
Dark theme for SRM eLab
View srm_elab.css
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; }
View bit_manipulation.c
// 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 Dec 22, 2020
Get Android API Distribution Stats right from PowerShell
View androidstats.ps1
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' }
View ppsassignmentunit5.c
#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 Apr 22, 2020
IntelliJ Structural Replace for changing annotation value
View Replace template
@UsesPermissions({
$LList$
})
@pavi2410
pavi2410 / SimpleLabel.java
Created Mar 30, 2020
GSOC Proposal for Visible Component Extensions in App Inventor
View SimpleLabel.java
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;
View SadnessOfArray.c
#include <stdio.h>
int main() {
int n;scanf("%d", &n);
int arr[n];
int i, j;
for(i=0;i<n;i++)
scanf("%d", &arr[i]);
int res[n];