Skip to content

Instantly share code, notes, and snippets.

View Sergiovan's full-sized avatar
🙃
Parsing

Sergiovan Sergiovan

🙃
Parsing
View GitHub Profile
@Sergiovan
Sergiovan / cargo.toml
Created February 16, 2024 13:46
imgui-rs with raylib-rs
[package]
name = "imgui-raylib"
version = "0.1.0"
edition = "2021"
[dependencies]
imgui = "0.11.0"
copypasta = "0.8.2"
[dependencies.raylib]
@Sergiovan
Sergiovan / widget.html
Last active January 11, 2022 20:59
Buzzly widget code for Agna
<div class="relative z-0 m-0 py-0">
<!-- Top triangle -->
<img src="https://imgur.com/AQSfa7p.png"/>
<!-- Center bit. Since buzzly has several numbers and colors in jail, we had to make an image as background that
basically grows as needed, and always fills the entire section. Very hacky, hopefully works well -->
<div class="relative min-w-full max-w-full w-full">
<img src="https://imgur.com/giSx522.png" class="absolute top-0 left-0 min-h-full max-h-full min-w-full z-0"/>
<div class="relative text-white z-10 max-h-full min-w-11/12 max-w-11/12 w-11/12 flex justify-center px-10">
<div class="w-96">
@Sergiovan
Sergiovan / widget.html
Last active January 10, 2022 20:29
Buzzly widget code
<!-- Buzzly actually deletes comments so I'm putting them here only :D -->
<div class="relative flex flex-col sm:flex-row m-4 p-2 pb-6 shadow-inner rounded bg-white overflow-hidden justify-between gap-4 text-gray-800">
<!-- This is the box where the data goes -->
<div class="flex-grow-1 flex flex-col">
<div class="flex flex-col mb-2 gap-2">
<div class="flex flex-row rounded-full p-2 pr-12 self-center bg-gray-100">
<!-- Put your avatar in this img -->
<img class="ring ring-blue-400 rounded-full" src="YOUR AVATAR OR IMAGE HERE" title="Avatar" alt="" width="128">
@Sergiovan
Sergiovan / shit?.js
Last active August 10, 2017 14:55
Maybe better?
$(document).ready(function(){
$('ul.pivotTabs li').click(function() {
if (!$(this).hasClass("selected")) {
let selectedTab = $('ul.pivotTabs li.selected');
let selectedItem = $(`ul.pivotItems li[data-id="${ $('a', selectedTab).attr('href') }"]`); // Template literals, wooo
$(this).addClass("selected"); // Clarity
selectedTab.removeClass("selected");
selectedItem.removeClass('selected');
@Sergiovan
Sergiovan / Failure_to_plan.c
Last active June 30, 2017 14:28
This incredibly common (not) case will break your function finder
int is_a(char* str) { return strcmp(str, "plan to fail");} int main(){ char edge_case = 1;
return /*Failure to plan*/ is_a("plan to fail");
}
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main(int argc, char** argv){
char* in = malloc(100);
int j, length;
puts("Input a string");
scanf("%s", in);
length = j = (strlen(in)-1);