Skip to content

Instantly share code, notes, and snippets.

⌛️
Partially offline. No time...

Rubén de Celis Hernández RDCH106

⌛️
Partially offline. No time...
Block or report user

Report or block RDCH106

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@RDCH106
RDCH106 / explicit_method.cpp
Created Apr 15, 2019
Explicit directive simulation for method arguments and avoid implicit conversion
View explicit_method.cpp
#include <iostream>
#include <string>
#include <vector>
#include <type_traits>
struct A
{
operator const char*() {
return m_str.c_str();
}
@RDCH106
RDCH106 / md2rst.py
Created Apr 15, 2019
Script to convert Markdown (.md) to ReStructuredText (.rst)
View md2rst.py
# -*- coding: utf-8 -*-
try:
import pypandoc
except ImportError:
print("pypandoc not available!!")
exit("First install pypandoc. Ex: \"pip install pypandoc\"")
long_description = pypandoc.convert('README.md', 'rst', outputfile='README.md2rst')
@RDCH106
RDCH106 / cpp_inheritance_with_functions_with_default_parameter_example.cpp
Created Mar 21, 2019
C++ Inheritance with functions with default parameter example
View cpp_inheritance_with_functions_with_default_parameter_example.cpp
#include <iostream>
#include <string>
#include <vector>
struct A
{
void f_sinarg() {
f(3);
}
@RDCH106
RDCH106 / python_switch_examples.py
Last active Dec 2, 2018
Examples of switch flow control structure in Python
View python_switch_examples.py
#############################
# Example with values
#############################
def switch_value(x):
return{
0: "APPLE",
1: "ORANGE",
2: "BANANA",
3: "PEACH"
View cpp_callback_example.cpp
#include <iostream>
#include <string>
#include <vector>
// Dll
typedef bool (*PointerToF)(int number);
struct A {
PointerToF m_f;
View Python TCP Client Example.py
import socket
hostname, sld, tld, port = 'www', 'integralist', 'co.uk', 80
target = '{}.{}.{}'.format(hostname, sld, tld)
# create an ipv4 (AF_INET) socket object using the tcp protocol (SOCK_STREAM)
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# connect the client
# client.connect((target, port))
@RDCH106
RDCH106 / .htaccess
Created Jun 22, 2018 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
View .htaccess
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@RDCH106
RDCH106 / file_content_replacer.py
Created Mar 20, 2018
Searching and Replacing Text in a File
View file_content_replacer.py
#!/usr/bin/env python
import os
import sys
nargs = len(sys.argv)
if not nargs == 5:
print("usage: %s search_text replace_text infile outfile" % os.path.basename(sys.argv[0]))
elif sys.argv[3] == sys.argv[4]:
@RDCH106
RDCH106 / cpp_logger.h
Created Jan 23, 2018
C++ logger with logging levels (standard output)
View cpp_logger.h
#pragma once
#if defined(___LOG_DEBUG)
# include <iostream>
# define LOGD(...) std::cout << " " << __VA_ARGS__ << "\t - " << LOG_TAG << std::endl;
# define LOGI(...) std::cout << " " << __VA_ARGS__ << "\t - " << LOG_TAG << std::endl;
# define LOGW(...) std::cout << " * Warning: " << __VA_ARGS__ << "\t - " << LOG_TAG << std::endl;
# define LOGE(...) std::cout << " *** Error: " << __VA_ARGS__ << "\t - " << LOG_TAG << std::endl;
#elif defined(___LOG_INFO)
@RDCH106
RDCH106 / DI.m3u
Last active Apr 23, 2019 — forked from sim642/DI.m3u
Digitally Imported premium streams
View DI.m3u
#EXTM3U
#EXTINF:-1,Digitally Imported - Ambient
http://pub1.diforfree.org:8000/di_ambient_hi
#EXTINF:-1,Digitally Imported - Big Room House
http://pub1.diforfree.org:8000/di_bigroomhouse_hi
#EXTINF:-1,Digitally Imported - Breaks
http://pub1.diforfree.org:8000/di_breaks_hi
You can’t perform that action at this time.