Skip to content

Instantly share code, notes, and snippets.

💭
Travelling 🌴

Peter Mescalchin magnetikonline

💭
Travelling 🌴
Block or report user

Report or block magnetikonline

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@eyecatchup
eyecatchup / pdf2docx.py
Last active Oct 17, 2019
Convert PDF files to Microsoft Office Word compatible doc/docx files, using LibreOffice's command line interface.
View pdf2docx.py
#!C:/Python27/python.exe
#
# Convert PDF files to Microsoft Office Word compatible doc/docx files,
# using LibreOffice's command line interface.
#
# http://stackoverflow.com/questions/26358281/convert-pdf-to-doc-python-bash
# http://ask.libreoffice.org/en/question/20111/converting-files-using-soffice-convert-to-with-embedded-images-html-to-doc/
# http://cgit.freedesktop.org/libreoffice/core/tree/filter/source/config/fragments/filters
#
@firstdoit
firstdoit / nodejs-ubuntu-bind-port-80.md
Last active Sep 26, 2019
Allow Node.js to bind to privileged ports without root access on Ubuntu
View nodejs-ubuntu-bind-port-80.md

How to: Allow Node to bind to port 80 without sudo

TL;DR

Only do this if you understand the consequences: all node programs will be able to bind on ports < 1024

sudo setcap 'cap_net_bind_service=+ep' /usr/local/bin/node

Important: your node location may vary. Use which node to find it, or use it directly in the command:

@psebborn
psebborn / countCSSRules.js
Last active Jan 18, 2019
Count the number of rules and selectors for CSS files on the page. Flags up the >4096 threshold that confuses IE
View countCSSRules.js
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {
@cdown
cdown / gist:1163649
Last active Nov 3, 2019
Bash urlencode and urldecode
View gist:1163649
urlencode() {
# urlencode <string>
old_lc_collate=$LC_COLLATE
LC_COLLATE=C
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:i:1}"
case $c in
[a-zA-Z0-9.~_-]) printf "$c" ;;
You can’t perform that action at this time.