Skip to content

Instantly share code, notes, and snippets.

Data & Mathematics lover.

Leonardo Rifeli leonardorifeli

Data & Mathematics lover.
View GitHub Profile
xthiago / Approach 01 - rely on a third-party
Last active Jul 16, 2019
Alternatives to test classes that rely on system time.
View Approach 01 - rely on a third-party

Value object that depends on system time:



namespace Xthiago;

final class BirthDate
View sendString.js
// the wizare functions
var sendString = (function(rfb, force, sendDelay) {
sendDelay = sendDelay || 25;
var _q = [];
var _qStart = function() {
var chr = _q.shift();
if (chr) {
setTimeout(_qStart, sendDelay);
haircut / Install PIP to user site on
Created Aug 29, 2017
How to install and use pip without sudo or admin on macOS
View Install PIP to user site on

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 -o ~/Downloads/
  2. Run the installation, appending the --user flag; python ~/Downloads/ --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


coboshm / golang_kinesis.go
Created Aug 21, 2017
Golang + Kinesis firehose
View golang_kinesis.go
package main
import (
satendrakumar / DataFrameWithFileName.scala
Last active Apr 15, 2020
Add file name as Spark DataFrame column
View DataFrameWithFileName.scala
import org.apache.spark.sql.functions._
import org.apache.spark.sql.SparkSession
object DataFrameWithFileNameApp extends App {
val spark: SparkSession =
.config("spark.master", "local[*]")
leonardorifeli / People.php
Last active Sep 22, 2017
Working with annotations using the doctrine annotation reader
View People.php
* @PeopleAnnotation(description="Get all information about a people", type="class")
class People {
* @PeopleAnnotation(description="Use to people name", type="attribute")
leonardorifeli / generator.php
Created Oct 15, 2015 — forked from tawfekov/generator.php
Doctrine2 Generate Entities form Existing Database
View generator.php
include '../vendor/autoload.php';
$classLoader = new \Doctrine\Common\ClassLoader('Entities', __DIR__);
$classLoader = new \Doctrine\Common\ClassLoader('Proxies', __DIR__);
// config
$config = new \Doctrine\ORM\Configuration();
netojoaobatista /
Last active Apr 9, 2020
Random commit messages
git config --global alias.cowsay '!git commit -m "`fortune | cowsay -f tux`"'
View validate.php
public function validate()
return $this->loginValidate();
private function loginValidate($attempt = 0)
try {
if ($this->user->validarDadosLogin()) {
//Autenticaçõa na base de dados
nicolasembleton /
Last active Aug 7, 2020
Restart Bluetooth Daemon on Mac OS X without restarting
sudo kextunload -b
sudo kextload -b
You can’t perform that action at this time.