Skip to content

Instantly share code, notes, and snippets.

View zodman's full-sized avatar
🤗
Code wins arguments!

Andres Vargas zodman

🤗
Code wins arguments!
View GitHub Profile
@zodman
zodman / FDFParser.py
Created October 21, 2021 16:35 — forked from lizettepreiss/FDFParser.py
How to parse a .fdf file in Python. The intention was to export comments I'd made in a .pdf (using Adobe Reader DC's commenting capability) and make them available elsewhere to use as a basis for further notes.
from pdfminer.pdfparser import PDFParser
from pdfminer.pdfdocument import PDFDocument
from pdfminer.pdftypes import resolve1
# I exported the comments I had made in an Adobe Reader DC document to f:temp/stn.fdf.
# Now I wanted to access those comments outside of the Adobe Reader. Here is how I extracted the comments.
fdf_file = open("F:/temp/stn.fdf", 'rb')
@zodman
zodman / intro.md
Created June 6, 2020 03:13 — forked from GochoMugo/intro.md
Node.js Debug Package as a Dev-Dependency

The [debug][debug] module for Node.js is one of the most useful utilities when it comes to high-level debugging. The only problem with using it, would that the module eventually becomes a hard dependency in your project. Your project will NOT run if the package is not installed despite the fact that it is only needed in development mode.

One way to work around this to have a dummy function used in place of the real debug function, when users are in production mode.

var debug = process.env.DEBUG ? require("debug")("MyProject:Server") : function() {};

This way, the module is only loaded when the DEBUG environment variable is set. Therefore, the package can be added as a devDependency to the project's package.json rather than as a dependency.

@zodman
zodman / hrtool.py
Last active August 22, 2019 07:09 — forked from miratcan/hrtool.py
A python script to run hackerrank answers on your local. Just run it in the sample test cases folder that you downloaded from hackerrank.
import re
import glob
import subprocess
from os.path import exists
from sys import exit
INPUT_FOLDER = 'input/'
OUTPUT_FOLDER = 'output/'
@zodman
zodman / gist:c81f343d01435388d9264aa14fa5d638
Created February 8, 2019 19:03 — forked from sdoro/gist:4291961
restart OpenVPN server in CLI pfsense
echo "<?php include('openvpn.inc'); openvpn_resync_all();?>" | php -q
@zodman
zodman / Steps to Obtain Client Secret.md
Created October 4, 2018 00:27 — forked from darthShadow/Steps to Obtain Client Secret.md
Mega Account Creator. Handles registration using megareg. Handles verification using Google Client API.
  1. Use this wizard to create or select a project in the Google Developers Console and automatically turn on the API. Click Continue, then Go to credentials.
  2. On the Add credentials to your project page, click the Cancel button.
  3. At the top of the page, select the OAuth consent screen tab. Select an Email address, enter a Product name (Mega Account Creator) if not already set, and click the Save button.
  4. Select the Credentials tab, click the Create credentials button and select OAuth client ID.
  5. Select the application type Other, enter the name "Mega Account Creator", and click the Create button.
  6. Click OK to dismiss the resulting dialog.
  7. Click the Download JSON button to the right of the client ID.
  8. Move this file to your working directory and rename it client_secret.json.
@zodman
zodman / gist:cbcbd90333adc010fc86767b287fe689
Created August 2, 2018 17:13 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@zodman
zodman / VideoStream.php
Created January 22, 2018 08:13 — forked from ranacseruet/VideoStream.php
PHP VideoStream class for HTML5 video streaming
<?php
/**
* Description of VideoStream
*
* @author Rana
* @link http://codesamplez.com/programming/php-html5-video-streaming-tutorial
*/
class VideoStream
{
private $path = "";
@zodman
zodman / app.js
Created August 28, 2017 22:54 — forked from taiansu/app.js
Phoenix brunch config which just make sense
import "phoenix_html"
import "bootstrap"
import "jquery"
import "toastr"
// ...
@zodman
zodman / 0_reuse_code.js
Created August 17, 2017 22:58
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@zodman
zodman / daisuki.py
Created December 4, 2015 03:36 — forked from intact/daisuki.py
Daisuki plugin for livestreamer
import base64
import json
import random
import re
import time
try:
from Crypto import Random
from Crypto.Cipher import AES, PKCS1_v1_5
from Crypto.PublicKey import RSA