Skip to content

Instantly share code, notes, and snippets.

View fabiopedrosa's full-sized avatar

Fábio Pedrosa fabiopedrosa

View GitHub Profile
@fabiopedrosa
fabiopedrosa / custom.css
Last active July 26, 2019 11:42
Slack custom css
/*
// Override Slack CSS
// Open: C:\Users\<username>\AppData\Local\slack\app-4.0.0\resources
// npm install -g asar
// asar extract-file app.asar dist/ssb-interop.bundle.js
document.addEventListener('DOMContentLoaded', function() {
$.ajax({
@fabiopedrosa
fabiopedrosa / custom.css
Created July 26, 2019 11:31
Slack custom css
as
from pyelasticsearch import ElasticSearch, ElasticHttpNotFoundError
from pyparsing import *
import unittest
ELASTICSEARCH_INDEX = 'myindex'
ELASTICSEARCH_URL = 'http://localhost:9200/'
es = ElasticSearch(ELASTICSEARCH_URL)
void clear_numbers(int vector[], int s) {
char cleared_vector[Size];
int index_original_vector = 0;
int index_cleared_vector = 0;
int same_count = 0;
while (index_original_vector < s) {
printf("%d,", index_original_vector);
function loadMore() {
$("html, body").animate({ scrollTop: $(document).height() }, 500);
if ( $('.js-infinite-marker').length > 0 ) {
setTimeout(loadMore, 500);
} else {
var times = {};
$('.list-item').each(function() {
var href = $(this).find('.item-title a').attr('href');
var t = $(this).find('time').data('text-time');
@fabiopedrosa
fabiopedrosa / django_ami.md
Created April 13, 2016 11:06 — forked from aderowbotham/django_ami.md
Django stack setup on EC2 AMI

Django Stack

Overview

This is a set of instructions to setup a Django Nginx Gunicorn MySQL/Postgres stack on a single Amazon EC2 instance.

Server - AWS

@fabiopedrosa
fabiopedrosa / install-redis.sh
Created January 26, 2016 10:14 — forked from FUT/install-redis.sh
Install Redis on EC2
1. Install Linux updates, set time zones, followed by GCC and Make
sudo yum -y update
sudo ln -sf /usr/share/zoneinfo/America/Indianapolis \
/etc/localtime
sudo yum -y install gcc make
2. Download, Untar and Make Redis 2.8 (check here http://redis.io/download)
@fabiopedrosa
fabiopedrosa / helloworld-win32-service.py
Created January 21, 2016 16:08 — forked from drmalex07/helloworld-win32-service.py
An example Windows service implemented with pywin32 wrappers. #python #windows-service #pywin32
import win32serviceutil
import win32service
import win32event
import servicemanager
import socket
import time
import logging
logging.basicConfig(
filename = 'c:\\Temp\\hello-service.log',
import os
import sys
import pickle
import console
# I moved 'dropboxlogin' into a sub folder so it doesn't clutter my main folder
sys.path += [os.path.join(os.path.dirname(os.path.abspath(__file__)), 'lib')]
import dropboxlogin # this code can be found here https://gist.github.com/4034526
STATE_FILE = '.dropbox_state'