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
// swift-tools-version:5.3 | |
import PackageDescription | |
let package = Package( | |
name: "ExtensionsFoundation", | |
products: [ | |
.library( | |
name: "ExtensionsFoundation", | |
targets: ["ExtensionsFoundation"]), |
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
#!/bin/bash | |
echo "Hello, script!" > /tmp/a.log |
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
# List all available remotes | |
git remote -v | |
# Push to a selected remote | |
git push <a name from the list above> |
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
cat $(find . -type f) | grep memcpy |
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
void *callstack[128]; // 1 | |
int frames = backtrace(callstack, 128); // 2 | |
char **strs = backtrace_symbols(callstack, frames); // 3 |
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
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 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 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 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 ================================== |
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
M-x set-face-background | |
magit-section-highlight | |
red |
NewerOlder