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 | |
# create temp files for html and pdf output | |
tin=$(tempfile) || exit | |
tout=$(tempfile) || exit | |
trap "rm -f -- '$tin'" EXIT | |
trap "rm -f -- '$tout'" EXIT | |
# write stdin to input temp file | |
echo "$(</dev/stdin)" > "$tin" |
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
CSS: | |
@import url('https://fonts.googleapis.com/css2?family=Asul:wght@700&family=Open+Sans&display=swap'); | |
@import url('https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css'); | |
@page{ | |
size:A4; | |
margin:5cm 2cm 2cm 2cm; | |
@top-center{ | |
content:element(MyHeader); |
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
CSS: | |
section:first-of-type{ | |
position:absolute; | |
bottom:0; | |
} | |
section:nth-of-type(2){ | |
break-before:always; | |
} |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Firstname Lastname - CV</title> | |
<style> | |
@import url('https://fonts.googleapis.com/css2?family=Asul:wght@700&family=Open+Sans&display=swap'); | |
@import url('https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css'); |
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
<?php | |
$sPdfContent = file_get_contents("filename.pdf"); | |
$sRegexPattern = "/R\/[A-Za-z0-9\s\/\[\.\]]*\/Title\(([A-Za-z0-9\.\s\:]*)\)[\/Prev|>>]/"; | |
preg_match_all($sRegexPattern, $sPdfContent, $aBookmarkMatches); | |
$aBookmarkTitles = $aBookmarkMatches[1]; | |
foreach($aBookmarkTitles as $sBookmarkTitle) { | |
echo $sBookmarkTitle . '<br />'; |
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
String.prototype.getParams = function (search) { | |
var params = null; | |
var paramsObject = new Object(); | |
if(search && search != ""){ | |
params = this.substr(this.indexOf(search) + search.length + 1, this.length); | |
return params.substr(0, ((params.indexOf("&") == "-1") ? params.length : params.indexOf("&"))); | |
} | |
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
String.prototype.getParams = function (search) { | |
var params = null; | |
var paramsObject = new Object(); | |
if(search && search != ""){ | |
params = this.substr(this.indexOf(search) + search.length + 1, this.length); | |
return params.substr(0, ((params.indexOf("&") == "-1") ? params.length : params.indexOf("&"))); | |
} | |
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
String.prototype.splitColor = function(){ | |
var color = this.replace("#", ""); | |
if(color.indexOf(',') == -1 && color.indexOf(' ') == -1){ | |
if(color.length == 6){ | |
return [color.substr(0,2), color.substr(2,2), color.substr(4,2)]; | |
}else if(color.length == 3){ | |
return [color.substr(0,1), color.substr(1,1), color.substr(2,1)]; |