Skip to content

Instantly share code, notes, and snippets.

View jeandudey's full-sized avatar
🦅

Jean-Pierre De Jesus DIAZ jeandudey

🦅
View GitHub Profile
@jeandudey
jeandudey / keybase.md
Created December 4, 2019 23:26
Keybase Proof

Keybase proof

I hereby claim:

  • I am jeandudey on github.
  • I am jeandudey (https://keybase.io/jeandudey) on keybase.
  • I have a public key ASAQQcXSvIGBEFFbiclUkhnBcCxLxS9xonBi3nMFwCDg-Qo

To claim this, I am signing this object:

@jeandudey
jeandudey / test.cpp
Created November 14, 2019 02:15 — forked from gustavosinbandera1/test.cpp
test
#include <cstdint>
#include <sstream>
#include <Arduino.h>
#include <unity.h>
/* #include "SerializablePOD.h"
#include "TinyString.h" */
#include "WiFiDTO.h"

Keybase proof

I hereby claim:

  • I am jeandudey on github.
  • I am jeandudey (https://keybase.io/jeandudey) on keybase.
  • I have a public key ASB37EPliyo3PyIkV2qrReowD4m8ETwi3nESaHq3ggFDcAo

To claim this, I am signing this object:

impl<'a> std::ops::Sub<Vec3> for &'a Vec3 {
type Output = Vec3;
fn sub(self, other: Vec3) -> Vec3 {
let mut output = Vec3::new([0f64; 3]);
for index in 0..3 {
output.vector[index] = self.vector[index] - other.vector[index];
}
return output;
}
}
@jeandudey
jeandudey / main.c
Created December 27, 2015 13:52
GTK borderless window
#include <stdio.h>
#include <gtk/gtk.h>
void hello(GtkWidget* widget, gpointer data)
{
printf("Hello World!\n");
}
int main(int argc, char* argv[])
{
@jeandudey
jeandudey / copy-dlls.py
Created August 16, 2015 14:46
Copy list of DLL files to the runtime directory (build).
#!/usr/bin/python3
import shutil
# Description: copy list of dlls to the given directory.
DLLS = ["libglibmm-2.4-1.dll",
"libgtkmm-3.0-1.dll",
"libgobject-2.0-0.dll",
"libglib-2.0-0.dll",
@jeandudey
jeandudey / literalstring.py
Created August 10, 2015 21:04
String to char literals (to use it with PEGTL).
#!/usr/bin/python3
# Description: convert an string to a "literal string" (i.e. 'H', 'e', 'l', 'l', 'o')
# to use in PEGTL (i.e pegtl::string< 'H', 'e', 'l', 'l', 'o', ',', ' ' >).
def toliteralstring(str):
result = ""
for c in str:
result += "'" + c "' "
@jeandudey
jeandudey / README.md
Last active August 29, 2015 14:25
Can i wrap argc and argv to an object in C++?

Can i wrap argc and argv to an object in C++?

Lets say you're a purist object oriented programmer and you want wrap the argc and argv constant variables in a more situable container like std::vector and don't know how?

Here is the pre-canned solution just for you (licensed under the [WTFPL][1]):

// File: ArgumentsList.hpp
typedef std::vector<std::string> ArgumentsList;

void fill_arguments(ArgumentsList &amp;args, int argc, const char **argv)
@jeandudey
jeandudey / UAGS.cc
Created July 27, 2015 15:49
Universal Acronym Generating System [/r/programmingprompts]
#include <iostream>
#include <sstream>
#include <string>
#include <locale>
#define MAX_WORDS 20
std::string acronymise(std::string str)
{
std::string words[MAX_WORDS];
@jeandudey
jeandudey / Main.cc
Created July 25, 2015 14:48
Backward Text on C++.
#include <iostream>
#include <fstream>
#include <string>
int main(int argc, char **argv)
{
std::ifstream file("HelloWorld.txt");
std::string words;
if (file.is_open()) {