Skip to content

Instantly share code, notes, and snippets.

View leonardorifeli's full-sized avatar
🏡
Working from home

Leonardo Rifeli leonardorifeli

🏡
Working from home
View GitHub Profile
@satendrakumar
satendrakumar / DataFrameWithFileName.scala
Last active October 21, 2020 14:48
Add file name as Spark DataFrame column
import org.apache.spark.sql.functions._
import org.apache.spark.sql.SparkSession
object DataFrameWithFileNameApp extends App {
val spark: SparkSession =
SparkSession
.builder()
.appName("DataFrameApp")
.config("spark.master", "local[*]")
@coboshm
coboshm / golang_kinesis.go
Created August 21, 2017 07:54
Golang + Kinesis firehose
package main
import (
"log"
"encoding/json"
"fmt"
"os"
"math/rand"
@haircut
haircut / Install PIP to user site on macOS.md
Created August 29, 2017 21:50
How to install and use pip without sudo or admin on macOS

Install and use pip on macOS without sudo / admin access

Most recently tested on macOS Sierra (10.12.6)

  1. Download the installation script; curl https://bootstrap.pypa.io/get-pip.py -o ~/Downloads/get-pip.py
  2. Run the installation, appending the --user flag; python ~/Downloads/get-pip.py --user. pip will be installed to ~/Library/Python/2.7/bin/pip
  3. Make sure ~/Library/Python/2.7/bin is in your $PATH. For bash users, edit the PATH= line in ~/.bashrc to append the local Python path; ie. PATH=$PATH:~/Library/Python/2.7/bin. Apply the changes, source ~/.bashrc.
  4. Use pip! Remember to append --user when installing modules; ie. pip install <package_name> --user

Note

// the wizare functions
var sendString = (function(rfb, force, sendDelay) {
sendDelay = sendDelay || 25;
var _q = [];
var _qStart = function() {
var chr = _q.shift();
if (chr) {
rfb.sendKey(chr);
setTimeout(_qStart, sendDelay);
}
@xthiago
xthiago / Approach 01 - rely on a third-party service.md
Last active July 16, 2019 19:37
Alternatives to test classes that rely on system time.

Value object that depends on system time:

<?php

declare(strict_types=1);

namespace Xthiago;

final class BirthDate