This file contains hidden or 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
#!/bin/bash | |
# Check if an argument is provided | |
if [ -z "$1" ]; then | |
echo "Error: You must provide the path to a PDF file as an argument." | |
exit 1 | |
fi | |
pdf_file="$1" |
This file contains hidden or 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
// swift-tools-version:5.3 | |
import PackageDescription | |
let package = Package( | |
name: "ExtensionsFoundation", | |
products: [ | |
.library( | |
name: "ExtensionsFoundation", | |
targets: ["ExtensionsFoundation"]), |
This file contains hidden or 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
#!/bin/bash | |
echo "Hello, script!" > /tmp/a.log |
This file contains hidden or 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
# List all available remotes | |
git remote -v | |
# Push to a selected remote | |
git push <a name from the list above> |
This file contains hidden or 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
cat $(find . -type f) | grep memcpy |
This file contains hidden or 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
void *callstack[128]; // 1 | |
int frames = backtrace(callstack, 128); // 2 | |
char **strs = backtrace_symbols(callstack, frames); // 3 |
This file contains hidden or 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
static void *(*real_malloc)(unsigned long) = 0; // 1 | |
int malloc_counter = 0; // 2 | |
static void malloc_init(void) { // 3 | |
real_malloc = (void *(*)(unsigned long))dlsym(RTLD_NEXT, "malloc"); | |
if (real_malloc == 0) | |
fprintf(stderr, "Error in `dlsym`: %s\n", dlerror()); | |
} | |
void *malloc(unsigned long size) { // 4 |
This file contains hidden or 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
// | |
// Created by Rostyslav Druzhchenko on 05.09.2020. | |
// | |
#include <stdio.h> | |
#include <dlfcn.h> | |
#include <execinfo.h> | |
#include <string.h> | |
#include <stdlib.h> |
This file contains hidden or 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
void check_leaks(); | |
int main(int argc, const char *argv[]) { | |
//... | |
check_leaks(); | |
return 0; | |
} |
This file contains hidden or 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
// | |
// Created by Rostyslav Druzhchenko on 05.09.2020. | |
// | |
#include <stdio.h> | |
#include <dlfcn.h> | |
int malloc_counter = 0; | |
// ================================== PUBLIC ================================== |
NewerOlder