Skip to content

Instantly share code, notes, and snippets.

View LegolasVzla's full-sized avatar
🤓
Focusing

Manuel Carrero LegolasVzla

🤓
Focusing
View GitHub Profile
@zaloogarcia
zaloogarcia / pandas_to_spark.py
Last active April 19, 2022 16:20
Script for converting Pandas DF to Spark's DF
from pyspark.sql.types import *
# Auxiliar functions
# Pandas Types -> Sparks Types
def equivalent_type(f):
if f == 'datetime64[ns]': return DateType()
elif f == 'int64': return LongType()
elif f == 'int32': return IntegerType()
elif f == 'float64': return FloatType()
else: return StringType()
@dinhchi27
dinhchi27 / Key Sublime Text 3.2.1 Build 3207 - Sublime Text 3 License Key
Last active April 24, 2024 23:37
Key Sublime Text 3.2.1 Build 3207 - Sublime Text 3 License Key
Key Sublime Text 3.2.1 Build 3207
----- BEGIN LICENSE -----
Member J2TeaM
Single User License
EA7E-1011316
D7DA350E 1B8B0760 972F8B60 F3E64036
B9B4E234 F356F38F 0AD1E3B7 0E9C5FAD
FA0A2ABE 25F65BD8 D51458E5 3923CE80
87428428 79079A01 AA69F319 A1AF29A4
A684C2DC 0B1583D4 19CBD290 217618CD
@gunesmes
gunesmes / Dockerfile
Last active September 4, 2023 00:03
Run Locust in Dockers for performance testing.
FROM python:alpine3.7
RUN apk -U add ca-certificates python python-dev py-pip build-base && \
pip install --upgrade pip && \
pip install locustio pyzmq && \
apk del python-dev && \
rm -r /var/cache/apk/* && \
mkdir /locust
WORKDIR /locust
@bobquest33
bobquest33 / script_32_load_data.py
Last active March 9, 2020 05:07
The below script helps to load the data to a database using Pyspark. I used the following command to load the below data and it created a new table with appropriate data types in Postgres. This a very good feature I liked of PySpark data frames.
import os
import sys
from pyspark import SparkContext
from pyspark import SparkConf
from pyspark.sql import SQLContext
from pyspark.sql import SparkSession
from pyspark.sql import DataFrameReader
conf = SparkConf().setAppName('Simple App')
sc = SparkContext("local", "Simple App")
@Siva-Charan
Siva-Charan / Docker-find-dependent-child-image.md
Last active October 9, 2022 11:18
Docker: How to find the dependent child images?

Find the dependent child images on Docker

When you try to remove the docker image with the following command

docker rmi 6795374be8c1

Sometimes you might be facing below error:

Error response from daemon: conflict: unable to delete 6795374be8c1 (cannot be forced) - image has dependent child images

Below is the Docker command line used to find the dependent child images

@aseigneurin
aseigneurin / Spark high availability.md
Created November 1, 2016 16:42
Spark - High availability

Spark - High availability

Components in play

As a reminder, here are the components in play to run an application:

  • The cluster:
    • Spark Master: coordinates the resources
    • Spark Workers: offer resources to run the applications
  • The application:
@JonCole
JonCole / Redis-BestPractices-General.md
Last active April 27, 2024 12:50
Redis Best Practices

Some of the Redis best practices content has moved

This content from this markdown file has moved a new, happier home where it can serve more people. Please check it out : https://docs.microsoft.com/azure/azure-cache-for-redis/cache-best-practices.

NOTE: Client specific guidance listed below is still valid and should still be considered. I will update this document once all content has been moved.

@angrycoffeemonster
angrycoffeemonster / Sublime Text 3 Build 3103 License Key - CRACK
Created April 18, 2016 02:13
Sublime Text 3 Build 3103 License Key - CRACK
I use the first
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
@AmirHossein
AmirHossein / coordinatestoname.js
Last active December 25, 2023 11:15
Get City and Country name by coordinates via Google Maps api
// Demo: http://jsfiddle.net/xuyp8qb5/
// Note: You need Google Map API Key to run demo; bit.ly/2pBgToW
var latlng;
latlng = new google.maps.LatLng(40.730885, -73.997383); // New York, US
//latlng = new google.maps.LatLng(37.990849233935194, 23.738339349999933); // Athens, GR
//latlng = new google.maps.LatLng(48.8567, 2.3508); // Paris, FR
//latlng = new google.maps.LatLng(47.98247572667902, -102.49018710000001); // New Town, US
//latlng = new google.maps.LatLng(35.44448406385493, 50.99001635390618); // Parand, Tehran, IR
//latlng = new google.maps.LatLng(34.66431108560504, 50.89113940078118); // Saveh, Markazi, IR
@clhenrick
clhenrick / README.md
Last active April 1, 2024 14:55
PostgreSQL & PostGIS cheatsheet (a work in progress)