Skip to content

Instantly share code, notes, and snippets.

@DinisCruz
DinisCruz / Linked-in-post.md
Last active March 7, 2024 15:36
make LinkedIn Post page printer friendly

"Creating a 'Print-friendly' version of a LinkedIn post that can be shared as a PDF or PNG" - How hard could it be, right?

TL;DR: Use the JavaScript code from this GIST: https://gist.github.com/DinisCruz/d5e4bb4d8a6dcd7b25e31d160c747f1e

Unless I'm missing something very obvious, there isn't an easy way to create a PDF or a PNG image from a LinkedIn post (I need posts in this format so that I can easily share them on WhatsApp, Discord, or Slack).

As an example, I wanted to share the daily poem that I posted today (see https://www.linkedin.com/posts/diniscruz_here-is-a-poem-for-the-7th-of-march-2024-activity-7171459601492602880-Tkzs) with my family, which includes some members who are not on LinkedIn.

What I wanted was to create something like what you can see in pic2, i.e., a reasonably formatted pdf/png that allows for the easy reading of the post's content (and images).

function hide(selector) { $(selector).setAttribute('style','display:none')}
function remove(selector) { $(selector).remove()}
function remove_class(selector) { $(selector).setAttribute('class','')}
function move_left(count)
{
var eventObj = document.createEvent("Events");
eventObj.initEvent("keydown", true, true);
eventObj.which = 37; // left key
for (i=0; i < count ; i++) {
@DinisCruz
DinisCruz / Github-network-graph.js
Created September 10, 2019 14:04
Show a better network graph
function hide(selector) { $(selector).setAttribute('style','display:none')}
function remove(selector) { $(selector).remove()}
function remove_class(selector) { $(selector).setAttribute('class','')}
function move_left(count)
{
var eventObj = document.createEvent("Events");
eventObj.initEvent("keydown", true, true);
eventObj.which = 37; // left key
for (i=0; i < count ; i++) {
@DinisCruz
DinisCruz / bokeh.py
Last active May 15, 2019 21:08
Jupyter OSBot-Commands
#https://bokeh.pydata.org/
#http://bokeh.pydata.org/en/latest/docs/installation.html
#https://nbviewer.jupyter.org/github/bokeh/bokeh-notebooks/blob/master/quickstart/quickstart.ipynb
!pip install bokeh
from bokeh.plotting import figure
from bokeh.io import output_notebook, show
output_notebook()
from numpy import cos, linspace
x = linspace(-6, 60, 1200)
@DinisCruz
DinisCruz / print-okrs.js
Created August 24, 2018 07:53
Jira JQuery filters
$('.jira-issues th').css({ 'min-width' : '100px' } )
$('#title-text').height(100)
$('.jira-issues th:nth-child(1)').css({'min-width': '700px'})
@DinisCruz
DinisCruz / gulpfile.coffee
Created March 28, 2017 08:55
Simple gulp file to serve and watch Jekyll pages
browserSync = require('browser-sync').create();
gulp = require('gulp');
shell = require('gulp-shell');
gulp.task 'build', shell.task(['jekyll build --incremental'])
gulp.task 'reload-page', ['build'], -> browserSync.reload()
gulp.task 'default' , ['build'],->
@DinisCruz
DinisCruz / gist:1a5fbd548c15a7a6419366c8553f4837
Created January 8, 2017 22:30
Setup jenkins and GOGs on Docker
download docker
install docker (click cancel on the VirtualBox question)
on cmd.exe/sh
docker-machine create --driver=virtualbox default
docker-machine ssh default
docker run hello-world
docker run -it ubuntu bash
docker run -it -p 3000:3000 gogs/gogs
@DinisCruz
DinisCruz / set-cert-pwd.sh
Created December 14, 2016 11:16
Script to set the pwd to use curl with an bbc cert (exported in OSX from KeyChain access)
#!/bin/bash
echo
echo "Note: run this using . ./set-cert-pwd.sh to set the variable in the host bash (it is expected that the bbc-cert.p12 is in the current path"
echo "What is the .p12 password: "
read -s pwd
export P12_PWD=$pwd
echo "The password has been set to the P12_PWD variable"
echo
@DinisCruz
DinisCruz / setup-maven.sh
Created December 5, 2016 14:25
Jenkins install automation scripts (to work as jenkins jobs)
cd ~/_tools
wget http://mirror.catn.com/pub/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
tar xzvf apache-maven-3.3.9-bin.tar.gz
echo "export PATH=~/_tools/apache-maven-3.3.9/bin:$PATH" >> ~/.bashrc
@DinisCruz
DinisCruz / checking-if-app-exists.v1.sh
Last active October 12, 2016 15:32
Misc veracode code snippets
function does_application_exist {
local app_name=$1
local result=$(veracode_get_app_Id "$app_name")
if [[ "$result" != "" ]]; then
echo "it exists"
else
echo "it doesn't exist"
fi
}