Skip to content

Instantly share code, notes, and snippets.

View afr-dt's full-sized avatar
:octocat:

Alejandro Flores afr-dt

:octocat:
  • Personal
  • Mexico City
View GitHub Profile
@afr-dt
afr-dt / fix-dyld-missing-symbol-called-errors-on-m1-macs.md
Created April 26, 2022 19:25 — forked from adrienjoly/fix-dyld-missing-symbol-called-errors-on-m1-macs.md
Fix `dyld[]: missing symbol called` errors when running Node.js programs on M1 Macs

Problem

If you're getting this kind of error when running Node.js programs with binary dependencies that don't support M1 yet, e.g.:

$ yarn test
dyld[51175]: missing symbol called
dyld[51176]: missing symbol called
# syntax=docker/dockerfile:1
FROM python:3.8-slim-buster
WORKDIR /app
ENV ACCEPT_EULA=Y
RUN apt-get update -y && apt-get update \
&& apt-get install -y --no-install-recommends curl gcc g++ gnupg unixodbc-dev
@afr-dt
afr-dt / iterm2.md
Created November 26, 2021 16:59 — forked from squarism/iterm2.md
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@afr-dt
afr-dt / pandas_dataframe_difference.py
Created June 8, 2020 15:57 — forked from toddbirchard/pandas_dataframe_difference.py
Helper function to compare two DataFrames and find rows which are unique or shared.
def dataframe_difference(df1, df2, which=None):
"""Find rows which are different."""
comparison_df = df1.merge(df2,
indicator=True,
how='outer')
if which is None:
diff_df = comparison_df[comparison_df['_merge'] != 'both']
else:
diff_df = comparison_df[comparison_df['_merge'] == which]
diff_df.to_csv('data/diff.csv')
@afr-dt
afr-dt / README-Template.md
Created March 30, 2020 20:33 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@afr-dt
afr-dt / iterm2-solarized.md
Created October 27, 2019 07:06 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by
@afr-dt
afr-dt / description.md
Created September 28, 2018 18:57 — forked from mangecoeur/description.md
Pandas PostgresSQL support for loading to DB using fast COPY FROM method

This small subclass of the Pandas sqlalchemy-based SQL support for reading/storing tables uses the Postgres-specific "COPY FROM" method to insert large amounts of data to the database. It is much faster that using INSERT. To acheive this, the table is created in the normal way using sqlalchemy but no data is inserted. Instead the data is saved to a temporary CSV file (using Pandas' mature CSV support) then read back to Postgres using Psychopg2 support for COPY FROM STDIN.

@afr-dt
afr-dt / import_csv_to_mongo
Created September 11, 2018 06:29 — forked from mprajwala/import_csv_to_mongo
Store CSV data into mongodb using python pandas
#!/usr/bin/env python
import sys
import pandas as pd
import pymongo
import json
def import_content(filepath):
mng_client = pymongo.MongoClient('localhost', 27017)