Skip to content

Instantly share code, notes, and snippets.

View 64lines's full-sized avatar

Julian Alexander Murillo 64lines

  • Universidad Politécnica de Cartagena
  • Cartagena, Murcia - Spain
View GitHub Profile
@64lines
64lines / server.py
Created September 27, 2019 19:04
[PYTHON] - Server class to serve simple html objects.
import http.server
import socketserver
import sys
class Server:
"""
Server class to serve simple html objects.
"""
DEFAULT_PORT = 8000
@64lines
64lines / fabric_waves.html
Created September 23, 2019 15:19
[ALGORITHMIC ART] - Fabric Waves
<body>
<canvas id="can" width="1200" height="600">
</canvas>
<script>
ctx = can.getContext("2d");
size = 2;
space = 1;
lines = 1000;
@64lines
64lines / heartbeat.html
Last active September 22, 2019 16:57
[ALGORITHMIC ART] - Heartbeat
<body>
<canvas id="can" style="height:100%; width: 100%;"
style="border:1px solid #c3c3c3;">
</canvas>
<script>
var canvas = document.getElementById("can");
var ctx = canvas.getContext("2d");
num = 0;
colornum = 0;
@64lines
64lines / copy_command.sql
Last active August 18, 2019 19:50
Copy Command
copy schema.table
(field1, field2, field3, field4, field5)
from 's3://path/to/s3/folder/'
iam_role 'arn:aws:iam::<aws-account-id>:role/<role-name>'
format as csv;
@64lines
64lines / create_statement.sql
Created August 18, 2019 19:41
Create Statement
CREATE TABLE table_name (
column1 datatype,
column2 datatype,
column3 datatype,
....
);
@64lines
64lines / unload_command.sql
Last active December 11, 2020 19:43
Unload Command
unload ('select * from schema.table')
to 's3://path/to/s3/folder/'
iam_role 'arn:aws:iam::<aws-account-id>:role/<role-name>'
allowoverwrite
format as csv;
@64lines
64lines / mac.md
Created March 29, 2019 01:05
Connect to a WIFI Mac OSX

1. Turn off wifi on your macbook from the Mac OSX terminal command line:

networksetup -setairportpower en0 off

2. Turn on wifi on your macbook from the Mac OSX terminal command line:

networksetup -setairportpower en0 on

3. List available wifi networks from the Mac OSX terminal command line:

# Job to load data from platform events db to parquet
# Based on Ky's script
#
# Parameters:
# --MONTHS: amount of months to overwrite the data. If value is "ALL" load all data
import os
import sys
import math
from datetime import datetime
fact_df.createOrReplaceTempView('fact_df')
fact_df = spark.sql('select * from fact_df where id > 42')
fact_df = fact_df.alias('fact_df')
from pyspark.sql.functions import *
# Generating continuous ids on random rows
fact_df = fact_df.withColumn('id', row_number().over(Window.orderBy(rand()))).alias('fact_df')