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 | |
# Variables | |
# ------------------------------------------------------------------------------ | |
txtSuccess='\033[1;32m' | |
txtError='\033[0;31m' | |
txtNoColor='\033[0m' | |
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 | |
source flash.sh | |
# Variables | |
# ------------------------------------------------------------------------------ | |
pathLog=`echo $(pwd)/log.txt` | |
echo -n "Path to rename: " |
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
#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) |
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
#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/ |
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 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)) |
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 <iostream> | |
#include <string> | |
#include <vector> | |
// Dll | |
typedef bool (*PointerToF)(int number); | |
struct A { | |
PointerToF m_f; |
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
############################# | |
# Example with values | |
############################# | |
def switch_value(x): | |
return{ | |
0: "APPLE", | |
1: "ORANGE", | |
2: "BANANA", | |
3: "PEACH" |
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 <iostream> | |
#include <string> | |
#include <vector> | |
struct A | |
{ | |
void f_sinarg() { | |
f(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
# -*- 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') |
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 <iostream> | |
#include <string> | |
#include <vector> | |
#include <type_traits> | |
struct A | |
{ | |
operator const char*() { | |
return m_str.c_str(); | |
} |