Skip to content

Instantly share code, notes, and snippets.

View naveenwashere's full-sized avatar
🎯
Focusing

Naveen Kumar K naveenwashere

🎯
Focusing
View GitHub Profile
@iandanforth
iandanforth / fix.md
Created July 19, 2019 02:28
ModuleNotFoundError: No module named '_lzma'

If you see this error when trying to import pandas under osx 10.14 Mojave

ModuleNotFoundError: No module named '_lzma'

You may be missing the xz libraries (https://tukaani.org/xz/)

This may be corrected by using homebrew to install it.

@npearce
npearce / install-docker.md
Last active April 19, 2024 12:35
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@anvk
anvk / psql_useful_stat_queries.sql
Last active April 23, 2024 03:15
List of some useful Stat Queries for PSQL
--- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md
--- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192
-- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB.
------------
-- Basics --
------------
-- Get indexes of tables
@martinwicke
martinwicke / automobile.ipynb
Last active January 9, 2022 08:14
Estimator demo using Automobile dataset
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gandarez
gandarez / BinaryTreeFindLongestZigZag.cs
Created March 9, 2017 01:10
Find the longest zigzag from a binary tree
class Tree
{
public int x;
public Tree l;
public Tree r;
};
class Task3
{
public int solution(Tree T)
@GLMeece
GLMeece / latency_numbers.md
Last active March 1, 2024 10:02
Latency Numbers Every Programmer Should Know - MarkDown Fork

Latency Comparison Numbers

Note: "Forked" from Latency Numbers Every Programmer Should Know

Event Nanoseconds Microseconds Milliseconds Comparison
L1 cache reference 0.5 - - -
Branch mispredict 5.0 - - -
L2 cache reference 7.0 - - 14x L1 cache
Mutex lock/unlock 25.0 - - -
@Shellbye
Shellbye / ubuntu_spark_installer.sh
Last active October 9, 2018 07:58
Install spark 2.1.0 on ubuntu
sudo wget http://d3kbcqa49mib13.cloudfront.net/spark-2.1.0-bin-hadoop2.7.tgz
sudo tar -zxvf spark-2.1.0-bin-hadoop2.7.tgz
cd spark-2.1.0-bin-hadoop2.7
sudo cp conf/log4j.properties.template conf/log4j.properties
sudo sed -i -e 's/INFO/WARN/g' conf/log4j.properties
sudo cp conf/spark-env.sh.template conf/spark-env.sh
sudo cp conf/slaves.template conf/slaves
@iRbouh
iRbouh / UseAutoIncrementID.php
Last active December 20, 2022 02:26
Auto incrementing sequence Trait to use with jenssegers/laravel-mongodb for AI MySQL-like IDs
<?php
namespace App\Traits;
trait UseAutoIncrementID {
/**
* Increment the counter and get the next sequence
*
* @param $collection
@application2000
application2000 / how-to-install-latest-gcc-on-ubuntu-lts.txt
Last active February 21, 2024 03:02
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
@benlinton
benlinton / multiple_mysql_versions_for_development.md
Last active September 23, 2023 09:38
Multiple MySQL Versions with Homebrew

Multiple MySQL Versions for Development

Options included below:

  • Using Docker docker-compose
  • Using Homebrew brew

Using Docker (recommended)

This gist was originally created for Homebrew before the rise of Docker, yet it may be best to avoid installing mysql via brew any longer. Instead consider adding a barebones docker-compose.yml for each project and run docker-compose up to start each project's mysql service.