Skip to content

Instantly share code, notes, and snippets.

View tibaes's full-sized avatar
👻
Is it a paranormal distribution? Might be just a ghost note.

Rafael H Tibães tibaes

👻
Is it a paranormal distribution? Might be just a ghost note.
View GitHub Profile
@tibaes
tibaes / install.sh
Last active April 17, 2018 18:17
Vim :D
#!/bin/bash
mkdir -p ~/.vim/autoload ~/.vim/bundle
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
cd ~/.vim/bundle
git clone https://github.com/scrooloose/syntastic
git clone https://github.com/bling/vim-airline
git clone https://github.com/vim-airline/vim-airline-themes
git clone https://github.com/tpope/vim-fugitive
@tibaes
tibaes / instructions.sh
Last active November 29, 2017 12:13
mozilla fix for gtk dark themes
mkdir ~/.mozilla/firefox/*.default/chrome
cp userContent.css ~/.mozilla/firefox/*.default/chrome/
@tibaes
tibaes / pumpkin.txt
Created October 31, 2017 17:28
ASCII ART
@@@
@@@
@@@
@@@
@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@ @@@@@@@@@@@@@@@@ @@@@@@@@
@@@@@@@@@ @@@@@@@@@@@@@@ @@@@@@@@@
@@@@@@@@@@ @@@@@@@@@@@@ @@@@@@@@@@
@tibaes
tibaes / cv.py
Created May 22, 2017 17:17
Python + openCV on custom path
import sys
sys.version
sys.path.append('/usr/local/opt/opencv3/lib/python3.6/site-packages')
import cv2
cv2.__version__
import matplotlib
@tibaes
tibaes / calendar.swift
Created December 26, 2016 16:04
JTAppleCalendar by Code, "Unexpectedly found nil while unwrapping an Optional value" when setting .frame
import UIKit
import Foundation
import PlaygroundSupport
@testable import SwiftIconFont
@testable import JTAppleCalendar
class ADVDayCell : JTAppleDayCell {
var label: UILabel = UILabel()
override init(frame: CGRect) {
@tibaes
tibaes / gist:f24b8bdea5e0e0a16759926896d61b1a
Created October 16, 2016 07:59
node mysql web service
/** Application Dependencies */
var express = require('express');
var mysql = require('mysql');
/** New Application ENV OBJ */
var app = express();
/** Initiate Mysql Connection */
var connection = mysql.createConnection({
host: 'localhost',
//: Playground - noun: a place where people can play
import UIKit
var str = "Hello, playground"
import PlaygroundSupport
import UIKit
// let url = URL(string: "https://httpbin.org/ip")
@tibaes
tibaes / single
Created September 14, 2016 17:32
IPython display cv images
# Using docker goldenheart:1.1.0
# pip3 install matplotlib
# Import the required modules
%pylab inline
import cv2
from IPython.display import clear_output
frame = cv2.imread("image.jpg")
frame = cv2.cvtColor(frame, cv2.COLOR_RGB2BGR)
@tibaes
tibaes / fill.cpp
Created August 30, 2016 15:27
fill opencv mask
static void fill(cv::Mat &img, cv::Point center, const int offset = 3) {
cv::Mat target = img.clone();
std::cout << "Target value: " << (int)img.at<uchar>(center.y, center.x)
<< std::endl;
cv::circle(target, center, 5.0, cv::Scalar(128));
cv::imshow("fill_target", target);
cv::waitKey(0);
cv::Rect img_area(cv::Point(0, 0), img.size());
for (auto oy = -offset; oy <= offset && img.at<uchar>(center) == 0; ++oy) {
@tibaes
tibaes / CMakeLists.txt
Created February 1, 2016 12:19
Sample of CMake, opencv3 and c++11
cmake_minimum_required(VERSION 3.4.0)
project(wbboard)
set(OpenCV_DIR "/usr/local/Cellar/opencv3/3.1.0_1/share/OpenCV/")
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
add_library(wbboard SHARED wbboard.cpp)
target_link_libraries(wbboard ${OpenCV_LIBS})