Skip to content

Instantly share code, notes, and snippets.

View jflopezfernandez's full-sized avatar
🏈
Merry Start of the Football Season Eve!!!

Jose Fernando Lopez Fernandez jflopezfernandez

🏈
Merry Start of the Football Season Eve!!!
View GitHub Profile
@jflopezfernandez
jflopezfernandez / Read-Config.pl
Created February 1, 2019 00:35
Read configuration file in Perl
#/usr/bin/perl
use strict;
use warnings;
my $FileName = "Config.ini";
my %UserConfiguration;
open(CONFIG, "<:encoding(UTF-8)", $FileName) or die "Failed to open configuration: $FileName\n";
@jflopezfernandez
jflopezfernandez / Generate-LocalCert.ps1
Created February 1, 2019 06:10
Generating local certificate
New-SelfSignedCertificate -CertStoreLocation 'Cert:\LocalMachine\My' -DnsName 'nullptr.root.sx' -FriendlyName 'NullPtrException' -Subject "CN=Jose Fernando Lopez Fernandez" -Type Custom
# Output:
# PSParentPath: Microsoft.PowerShell.Security\Certificate::LocalMachine\My
#
# Thumbprint Subject
# ---------- -------
# xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx CN=Jose Fernando Lopez Fernandez
@jflopezfernandez
jflopezfernandez / Phone-Number-Parsing.java
Created February 4, 2019 09:24
Parsing phone numbers in Java with regular expressions
package com.company;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.*;
public class Main {
public static void main(String[] args) throws Exception {
List<String> PhoneNumbers = new ArrayList<String>();
@jflopezfernandez
jflopezfernandez / java-build.md
Created February 12, 2019 02:12
Bare-bones Java project build

Source: Apache Ant Manual

We have to create only the src directory. (Because I am working on Windows, here is the Windows syntax—translate to your shell):

md src

The following simple Java class just prints a fixed message out to STDOUT, so just write this code into src\oata\HelloWorld.java.

package oata;
@jflopezfernandez
jflopezfernandez / .gitconfig
Created March 10, 2019 09:25 — forked from pksunkara/config
Sample of git config file (Example .gitconfig)
[user]
name = Pavan Kumar Sunkara
email = [email protected]
username = pksunkara
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls
@jflopezfernandez
jflopezfernandez / keybase.md
Created March 11, 2019 16:23
Keybase proof gist

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@jflopezfernandez
jflopezfernandez / getcgi.c
Created March 11, 2019 21:46
CGI Server implementation from 1995
/*************************************************************************/
/** **/
/** getcgivars.c-- routine to read CGI input variables into an **/
/** array of strings. **/
/** **/
/** Written in 1996 by James Marshall, [email protected], except **/
/** that the x2c() and unescape_url() routines were lifted directly **/
/** from NCSA's sample program util.c, packaged with their HTTPD. **/
/** **/
/** For the latest, see http://www.jmarshall.com/easy/cgi/ . **/
@jflopezfernandez
jflopezfernandez / Makefile
Last active March 21, 2019 21:32
Makefile template
#==============================================================
#
#
#
# =============================================================
vpath %.cpp src
vpath %.hpp include
@jflopezfernandez
jflopezfernandez / Makefile
Created April 14, 2019 04:53
Intel C Compiler Optimization Flags
CFLAGS = -fast -fma -fno-exceptions -fomit-frame-pointer -qopt-matmul -qopt-dynamic-align -qopt-prefetch=5 -qopt-streaming-stores=auto -simd -foptimize-sibling-calls -ffnalias -fimf-absolute-error=0.00001:sin,sinf -fimf-max-error -fast-transcendentals -use-intel-optimized-headers
@jflopezfernandez
jflopezfernandez / Common.hpp
Last active April 14, 2019 21:33
Common C++ Header Files All In One
#ifndef PROJECT_INCLUDES_COMMON_HPP_
#define PROJECT_INCLUDES_COMMON_HPP_
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cstddef>
#include <cstdint>
#include <cctype>