Skip to content

Instantly share code, notes, and snippets.

View georgiana-gligor's full-sized avatar

Georgiana Gligor georgiana-gligor

View GitHub Profile
@georgiana-gligor
georgiana-gligor / most_recent.php
Last active December 20, 2018 07:40
preg_replace vs str_replace
<?php
$channels = array(
"UCgpy7yxv_7JbR26McdS1uQA",
"UCrHZJ6fddxeK2wwPIh5-O4Q",
"UCYUI-AaHyYslLLWAss4EiAA",
);
$res = 5;
$key = 'YOUR_KEY_HERE';
@georgiana-gligor
georgiana-gligor / check_for_null.php
Created January 9, 2017 15:35
Performance of null checking
<?php
define('DEFAULT_ITERATIONS', 1000000);
$myNull = null;
$options = getopt('n:');
$iterations = isset($options['n']) ? intval($options['n']) : DEFAULT_ITERATIONS;
logLine('iterations = ' . $iterations);
@georgiana-gligor
georgiana-gligor / osx-pdf-from-markdown.markdown
Last active September 27, 2024 09:55
Markdown source for the "Create PDF files from Markdown sources in OSX" article

Create PDF files from Markdown sources in OSX

When [Markdown][markdown] appeared more than 10 years ago, it aimed to make it easier to express ideas in an easy-to-write plain text format. It offers a simple syntax that takes the writer focus away from the formatting, thus giving her time to focus on the actual content.

The market abunds of editors to be used for help with markdown. After a few attempts, I settled to Sublime and its browser preview plugin, which work great for me and have a small memory footprint to accomplish that. To pass the results around to other people, less technical, a markdown file and a bunch of images is not the best approach, so converting it to a more robust format like PDF seems like a much better choice.

[Pandoc][pandoc] is the swiss-army knife of converting documents between various formats. While being able to deal with heavy-weight formats like docx and epub, we will need it for the more lightweight markdown. To be able to generate PDF files, we need LaTeX. On OSX, the s

@startuml
actor PayRollCron
participant PayDayTransaction
participant PayRoll
participant PayRollDatabase
participant Employee
participant PayCheck
@enduml