Skip to content

Instantly share code, notes, and snippets.

View KROSF's full-sized avatar
🚀
Learning things

Rodrigo Sanabria KROSF

🚀
Learning things
View GitHub Profile
@KROSF
KROSF / c_struct_init.c
Created May 10, 2019 08:36
C/Cpp tips and tricks
#include <stdio.h>
#include <stdlib.h>
struct Points{
int* x;
int* y;
};
int main(void) {
struct Points p = { .x = ((int[10]){0}), .y = ((int[]){4,5,6})};
@KROSF
KROSF / aciclico.tex
Last active June 6, 2019 18:39
Graphs
\documentclass[preview,border=4mm,convert={density=600,outext=.png}]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}
\begin{scope}[every node/.style={circle,thick,draw}]
\node (A) at (0,0) {0};
\node (B) at (2,2) {1};
\node (C) at (2,-2) {2};
\node (D) at (4,2) {3};

Keybase proof

I hereby claim:

  • I am krosf on github.
  • I am krosf (https://keybase.io/krosf) on keybase.
  • I have a public key ASAN7-1L6duQ2Brg4hXHwTBrBqaGW1eeObG2w8erf3Fn8wo

To claim this, I am signing this object:

@KROSF
KROSF / ubuntu.md
Last active March 16, 2024 12:19
Configuring ZSH

Configure ZSH using zplug and starship

Steps

Install zplug

curl -sL --proto-redir -all,https https://raw.githubusercontent.com/zplug/installer/master/installer.zsh | zsh
@KROSF
KROSF / index.md
Last active March 6, 2020 14:27
Typescript Tips && Tricks

Typescript Tips && Tricks

Recursive Partial

type RecursivePartial<T> = { [P in keyof T]?: RecursivePartial<T[P]> };

Type Guards

@KROSF
KROSF / Twig.php
Created April 14, 2020 20:01
Codeigniter 4 && Twig 3
<?php
namespace App\Libraries;
use Twig\Loader\FilesystemLoader;
use Twig\Environment;
use Twig\Extension\DebugExtension;
use Twig\TwigFunction;
class Twig {
--- common-debian.sh 2020-04-16 13:47:08.000000000 +0200
+++ common.sh 2020-04-16 13:57:17.000000000 +0200
@@ -99,11 +99,15 @@
# Optionally install and configure zsh
if [ "$INSTALL_ZSH" = "true" ]; then
apt-get install -y zsh
- sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
+ curl -fsSL https://starship.rs/install.sh | bash
+ curl -fsSL https://raw.githubusercontent.com/zimfw/install/master/install.zsh | zsh
echo "export PATH=\$PATH:\$HOME/.local/bin" | tee -a /root/.zshrc
@KROSF
KROSF / docker-setup.sh
Created July 21, 2020 13:00
Install docker and docker-compose
#!/usr/bin/env sh
COMPOSE_VERSION=1.26.2
sudo apt update
sudo apt upgrade -y
sudo apt install -y curl
curl -fsSL https://get.docker.com | sudo sh
sudo curl -L "https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
@KROSF
KROSF / spain.txt
Last active July 24, 2020 12:11
adguardblock
||atresmediapublicidad.com^
||mssl.fwmrm.net^
@KROSF
KROSF / taskfile.schema.json
Created October 24, 2020 12:58
Taskfile YAML Schema
{
"$schema": "http://json-schema.org/draft-07/schema",
"description": "Taskfile YAML Schema",
"oneOf": [
{
"type": "object",
"properties": {
"version": {
"description": "Specify the Taskfile format that this file conforms to.",
"anyOf": [