Skip to content

Instantly share code, notes, and snippets.

View jcmendez's full-sized avatar

Juan Carlos Mendez jcmendez

View GitHub Profile
@jcmendez
jcmendez / keybase.md
Last active December 24, 2021 20:14 — forked from webframp/keybase.md
Signing git commits on github using keybase.io gpg key

Probably one of the easiest things you'll ever do with gpg

Install Keybase: https://keybase.io/download and Ensure the keybase cli is in your PATH

First get the public key

keybase pgp export | gpg --import

Next get the private key

@jcmendez
jcmendez / gist:da254b4f3a6f1256e860535845818f2b
Created August 1, 2019 12:54
Install opencv on mac os, with fish shell, virtualfish (vf)
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local/ \
-D OPENCV_EXTRA_MODULES_PATH=~/Development/opencv_contrib-4.1.1/modules \
-D PYTHON3_LIBRARY=(python -c 'import subprocess ; import sys ; s = subprocess.check_output("python-config --configdir", shell=True).decode("utf-8").strip() ; (M, m) = sys.version_info[:2] ; print("{}/libpython{}.{}.dylib".format(s, M, m))') \
-D PYTHON3_INCLUDE_DIR=(python -c 'import distutils.sysconfig as s; print(s.get_python_inc())') \
-D PYTHON3_EXECUTABLE=(which python) \
-D BUILD_opencv_python2=OFF \
-D BUILD_opencv_python3=ON \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D INSTALL_C_EXAMPLES=OFF \

Keybase proof

I hereby claim:

  • I am jcmendez on github.
  • I am jcmendez (https://keybase.io/jcmendez) on keybase.
  • I have a public key ASCtlmbMo6RVCpO5R1QNQsixMeUAqgNez2JAMs5FjqW8aQo

To claim this, I am signing this object:

@jcmendez
jcmendez / normalize.vb
Created September 20, 2016 05:35
This is an Excel VB macro that allows one to convert an Excel range from a denormalized form (i.e. row and column headers are attributes) into normalized form (fixed number of columns, number of rows expand as attribute count increases)
Sub normalize()
' Takes a matrix with names in rows and columns and turns it into a
' normalized version.
' Names for rows and columns are expected to be outside the selection
' Cell {-1,-1} is an attribute to be repeated in all entries
' Spreadsheet name is an attribute to be repeated in all entries
' Will modify the row and column structure of the spreadsheet
' Will overwrite anyting in the destination area
' Will not check if there is enough space on the spreadsheet
enum Suit {}
enum Rank: Int {}
// In the example, let's say the Card is CustomStringConvertible so I can leverage all the external code
// that prints stuff, and depends on using the var description
struct Card : CustomStringConvertible {
var rank: Rank
var suit: Suit
var description : String {
@jcmendez
jcmendez / script.sh
Last active August 29, 2015 13:57
Linking git hashes and Xcode for builds
# Assumes that we tag versions with the version number (e.g., "1.1") and then the build number is
# that plus the number of commits since the tag (e.g., "1.1.17")
echo "Updating version/build number from git..."
plist_def="${SRCROOT}/git_version.h"
touch "${plist_def}"
# Use Xcode's copy of the Git binary
GIT=`xcrun -find git`
@jcmendez
jcmendez / freedns_plist_creator
Created October 1, 2013 11:52
Script to generate the plist for Mac OS X 10.7 and higher to maintain a freedns dynamic dns record updated. Once installed, it will ping the freedns service daily as long as the computer can reach the net, whether or not you are logged in as a user on your mac.
#!/usr/bin/env bash
# Script to generate the plist for Mac OS X 10.7 and higher to maintain a
# freedns dynamic dns record updated. Once installed, it will ping the
# freedns service daily as long as the computer can reach the net,
# whether or not you are logged in as a user on your mac.
#
# You need to edit the variables MY_DOMAIN_NAME and MY_TOKEN with the correct
# values you get from the freedns site
#
# Since the plist is stored under /System on your Mac, you must use sudo to