This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import inspect | |
class Pipe: | |
""" | |
Create a wrapper to pipe function calls with the given value. | |
The functions could be: value's method, builtin or any | |
function in the current module. | |
Examples: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# By Luiz Felipe Silva (https://github.com/Silva97) | |
## References ## | |
# sys_rt_sigreturn: https://elixir.bootlin.com/linux/latest/source/arch/x86/um/signal.c#L560 | |
# sigframe: https://elixir.bootlin.com/linux/latest/source/arch/x86/include/asm/sigframe.h | |
# ucontext: https://elixir.bootlin.com/linux/latest/source/include/uapi/asm-generic/ucontext.h | |
# sigcontext: https://elixir.bootlin.com/linux/latest/source/arch/x86/include/uapi/asm/sigcontext.h#L324 | |
import struct |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _GNU_SOURCE | |
#include <dlfcn.h> | |
typedef int (*puts_t)(const char *); | |
int puts(const char *string) | |
{ | |
puts_t original_puts = dlsym(RTLD_NEXT, "puts"); | |
original_puts("-- Hookado --"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int getint(int *number); | |
int main() | |
{ | |
int n; | |
fputs("Digite um inteiro cara: ", stdout); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/********************* | |
* Resolução do problema: https://leetcode.com/problems/reverse-integer/ | |
*********************/ | |
int aux_rev(int x, long long int rev) | |
{ | |
if(rev > INT_MAX || rev < INT_MIN) return 0; | |
if(!x) return rev; | |
return aux_rev(x/10, rev*10 + x%10); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
enum { | |
RECT_T = '-', // Aresta do topo | |
RECT_TR = '+', // Vértice do canto superior direito | |
RECT_R = '|', // Aresta da direita | |
RECT_BR = '+', // Vértice do canto inferior direito | |
RECT_B = '-', // Aresta da parte inferior | |
RECT_BL = '+', // Vértice do canto inferior esquerdo | |
RECT_L = '|', // Aresta da esquerda |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******************** | |
* Exemplo de replace em C. | |
* Por Luiz Felipe. | |
* https://github.com/Silva97 | |
********************/ | |
#include <stdio.h> | |
#include <string.h> | |
int replace(char *text, char *word, char *new); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******************** | |
* Developed by Luiz Felipe. | |
* | |
* GitHub: https://github.com/Silva97 | |
* Facebook: https://www.facebook.com/B4.0E.B0.48.CD.10.B0.69.CD.10.C3 | |
********************/ | |
#include <stdio.h> | |
#include <stdarg.h> | |
#include <limits.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******************** | |
* Exemplo desenvolvido por Luiz Felipe | |
* Link do vídeo: https://youtu.be/wUrk9AK6ItY | |
********************/ | |
#include <stdio.h> | |
char keyboard[BUFSIZ]; | |
void getinput(char *buff, int size); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Example by Luiz Felipe (Silva97) | |
* | |
* It's just an example. Don't consider it a final code and DON'T write | |
* all your code on a unique module, please. | |
* | |
* Tip: Use a struct to manipulate translate units instead of use only a | |
* FILE pointer ;) | |
*/ |
NewerOlder