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
/* | |
* Copyright (c) 2020-present Daniel Trugman | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is | |
* furnished to do so, subject to the following conditions: | |
* |
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 <unistd.h> | |
#include <stdlib.h> | |
#include <stdbool.h> | |
int main(int argc, char ** argv) | |
{ | |
const char * mystr = "default"; | |
int myint = 0; | |
float myfloat = 0.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
CXX = g++ | |
SRC = $(wildcard *.cpp) | |
OBJ = $(SRC:.cpp=.o) | |
CPPFLAGS = --std=c++14 | |
LDFLAGS = | |
app: $(OBJ) | |
$(CC) $(CPPFLAGS) -o $@ $^ $(LDFLAGS) |
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
#!/usr/bin/python3 | |
import sys | |
from os import getuid | |
from signal import pthread_kill | |
from argparse import ArgumentParser, RawDescriptionHelpFormatter | |
from binascii import hexlify | |
class MemoryRegion(): | |
def __init__(self, line): |
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 | |
# This is a helper script for using vagrant interactively | |
# Just run it without any parameters and follow the menu | |
ivagrant() { | |
declare vm_idx="$1" | |
declare vm_cmds="${@:2}" | |
# Read records |
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
''' | |
Copyright (c) 2021 Daniel Trugman | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
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 | |
git-describe() { | |
for dir in *; do | |
[[ -d "$dir" ]] || continue | |
[[ -d "$dir/.git" ]] || continue | |
local branch="$(cd "$dir"; git rev-parse --abbrev-ref HEAD)" | |
echo "$dir -> $branch" | |
done |
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 pandas as pd | |
# Create new DataFrame | |
data = { | |
"FirstName" : ["Daniel", "Jenny", "Mia"], | |
"LastName" : ["Trugman", "Altman", "Herman"], | |
"Age" : [35, 36, 28] | |
} | |
df = pd.DataFrame(data, index = [1, 2, 3]) | |
df.head() |