Skip to content

Instantly share code, notes, and snippets.

View naanadr's full-sized avatar

Maria Fernanda naanadr

View GitHub Profile
# macOS xargs has no -d (delimiter) option. But you can use BASH to do something similar :
cat myfile.txt | grep \n | while read -r line ; do echo "$line"; done
@johncrossland
johncrossland / Sphinx_with_Markdown.rst
Created December 12, 2018 00:28
Sphinx with Markdown - How to use Markdown with Sphinx (including Markdown tables that Sphinx does not handle by default for PDF and HTML output)

Sphinx with Markdown walkthrough for HTML and PDF output

This walkthrough installs Sphinx and configures it to output HTML and PDF from .md. If you install it on a VM, allocate over 25GB storage and multiple processors. You'll need Ubuntu 16.04 LTS, an internet connection, and sudo rights.

@toff63
toff63 / terraform_retrieve_secret_aws.tf
Created December 10, 2018 17:21
How to retrieve a secret stored in AWS Secret Manager in terraform.
variable "region" {}
variable "access_key" {}
variable "secret_key" {}
provider "aws" {
version = "~> 1.25"
region = "${var.region}"
access_key = "${var.access_key}"
secret_key = "${var.secret_key}"}
@wnarifin
wnarifin / thinkpad_a485_linux.md
Last active May 23, 2020 13:36
Installing Linux on Lenovo ThinkPad A485

Why

I was unable to boot to live Linux distro to install Linux on my newly bought A485 ThinkPad laptop. Although I was initially dissapointed, I was not alone. This gist documents the information I gathered from the net to complete the installation.

At the time of posting this gist, the issue is still persistent. It might not be relevant anymore once Lenovo release a working BIOS update to resolve the issue. [Update 19/01/2019]: Updating to BIOS 1.14 worked for me.

Sources

The information in this short gist was compiled from several sources. Although most are for E series, it worked for A485:

  1. https://www.reddit.com/r/thinkpad/comments/9ia3e4/linux_on_thinkpad_a485/
  2. https://evilazrael.de/node/401
@cesarhilario
cesarhilario / playlist_time.js
Last active November 21, 2023 14:31 — forked from fredericogg/playlist_time.js
Calcula o tempo total de uma playlist no Youtube. É só colar no console na página da playlist. Update para a nova interface do Youtube
(function () {
const timeContainer = document.querySelectorAll(
".ytd-thumbnail-overlay-time-status-renderer"
);
let timeSeconds = 0;
for (let i = 0; i < timeContainer.length; i++) {
const timeStr = timeContainer[i].innerText;
if (!/\d?\d:\d{2}(:\d{2})?/g.test(timeStr)) continue;
const timeParts = timeStr.split(":");
@ritiek
ritiek / folder_predict.py
Last active November 6, 2022 13:23
Keras predicting on all images in a directory
from keras.models import load_model
from keras.preprocessing import image
import numpy as np
import os
# image folder
folder_path = '/path/to/folder/'
# path to model
model_path = '/path/to/saved/model.h5'
# dimensions of images
@varyonic
varyonic / Dockerfile
Created June 10, 2016 14:14
Dockerfile with chromedriver
# See https://codeship.com/documentation/docker/browser-testing/
FROM myapp:base
# We need wget to set up the PPA and xvfb to have a virtual screen and unzip to install the Chromedriver
RUN apt-get install -y wget xvfb unzip
# Set up the Chrome PPA
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list
@erikbern
erikbern / use_pfx_with_requests.py
Last active October 24, 2024 12:26
How to use a .pfx file with Python requests – also works with .p12 files
import contextlib
import OpenSSL.crypto
import os
import requests
import ssl
import tempfile
@contextlib.contextmanager
def pfx_to_pem(pfx_path, pfx_password):
''' Decrypts the .pfx file to be used with requests. '''
@JJediny
JJediny / gist:a466eed62cee30ad45e2
Created October 5, 2015 20:42
Jekyll Liquid Cheatsheet

There are two types of markup in Liquid: Output and Tag.

  • Output markup (which may resolve to text) is surrounded by
{{ matched pairs of curly brackets (ie, braces) }}
  • Tag markup (which cannot resolve to text) is surrounded by
@mandiwise
mandiwise / Update remote repo
Last active October 23, 2024 07:20
Transfer repo from Bitbucket to Github
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/
// See also: http://www.paulund.co.uk/change-url-of-git-repository
$ cd $HOME/Code/repo-directory
$ git remote rename origin bitbucket
$ git remote add origin https://github.com/mandiwise/awesome-new-repo.git
$ git push origin master
$ git remote rm bitbucket