Skip to content

Instantly share code, notes, and snippets.

View lsferreira42's full-sized avatar

Leandro Ferreira lsferreira42

View GitHub Profile
#!/usr/bin/env python
# -*- coding: utf8 -*-
from flask import Flask, redirect, url_for
from markdown import markdown
import os
import re
# create the app
# TODO: load config/template from files, with fallbacks
@lsferreira42
lsferreira42 / twitter.js
Created August 26, 2014 19:45
Remove all followers from twitter
//Go to https://twitter.com/following
// Open Javascript console ( dev tools )
// And run:
setInterval(function(){$(".following").children("button").click();window.scrollBy(0,5000);}, 1000);
// ==UserScript==
// @name _Block CKEditor on the selected site(s)
// @include http://YOUR_SERVER.COM/YOUR_PATH/*
// @require https://gist.github.com/raw/2620135/checkForBadJavascripts.js
// @run-at document-start
// @grant GM_addStyle
// ==/UserScript==
/*- The @grant directive is needed to work around a design change
introduced in GM 1.0. It restores the sandbox.
*/
from fabric.api import env, task, run, sudo, cd, local
from fabric.decorators import with_settings
from fabric.operations import put
env.user = 'ec2-user'
env.hosts = [
'ec2-your-address-1.us-west-2.compute.amazonaws.com',
'ec2-your-address-2.us-west-2.compute.amazonaws.com',
'ec2-your-address-3.us-west-2.compute.amazonaws.com',
'ec2-your-address-4.us-west-2.compute.amazonaws.com',
@lsferreira42
lsferreira42 / openresty
Last active August 29, 2015 14:24 — forked from pwm/openresty
#!/bin/bash
#
# chkconfig: 2345 55 25
# description: Openresty
# processname: nginx
# config: /usr/local/openresty/nginx/conf/nginx.conf
# pidfile: /usr/local/openresty/nginx/logs/nginx.pid
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $local_fs $remote_fs $network $named $syslog $time
@lsferreira42
lsferreira42 / voices.sh
Created October 21, 2015 05:00 — forked from AndrewRayCode/voices.sh
All Mac computer voices. Some are funny, some are disturbing!
COLOR_LIGHT_RED=$(tput sgr0 && tput bold && tput setaf 1)
COLOR_LIGHT_CYAN=$(tput sgr0 && tput bold && tput setaf 6)
COLOR_RESET=$(tput sgr0)
say -v ? | while read line; do
voice=`echo $line | awk '{ print $1 }'`
phrase=`echo $line | sed -E 's/^.+# //'`
echo "${COLOR_LIGHT_RED}say -v ${COLOR_LIGHT_CYAN}${voice}${COLOR_RESET} $phrase"
say -v $voice $phrase
done
package main
import (
"fmt"
"net/http"
"sort"
"os"
)
func handler(w http.ResponseWriter, r *http.Request) {
@lsferreira42
lsferreira42 / README.md
Created August 28, 2016 23:44 — forked from adewes/README.md
Ebay Ads - Bot. Because who wants to write messages by hand...

To use this bot:

  • Download ads_bot.py and requirements.txt.
  • Type pip install -r requirements.txt to install the requirements.
  • Fill out the required information in the Python file.
  • Ideally, create a (free) Slack account and set up a web hook to receive notifications from the bot.
  • Run the script :)
  • Relax and be ready to answer incoming calls :D
@lsferreira42
lsferreira42 / client.go
Created January 16, 2018 21:17 — forked from spikebike/client.go
TLS server and client
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io"
"log"
)
<?php
//API KEY
$new_api_key = 'NOVACHAVEDEAPI';
//Pega as variaveis necessarias e testa a conexao
include_once "wp-config.php";
$link = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
if (!$link) {
die('cant connect to the database!');