Skip to content

Instantly share code, notes, and snippets.

View lfcipriani's full-sized avatar
💪
www.beat81.com

Luis Cipriani lfcipriani

💪
www.beat81.com
View GitHub Profile
@lfcipriani
lfcipriani / todoist_standup.py
Created April 21, 2020 15:31
Todoist Standup update generator
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# This script generates a basic standup update out of completed and due tasks in Todoist.
# It considers business days only and holidays (if configured)
#
# Setup:
#
# Use python >= 3
@lfcipriani
lfcipriani / terminalfred.plugin.zsh
Last active October 10, 2018 18:59
terminalfred.plugin.zsh
# -=-=-=- TERMINALFRED -=-=-=-
#
# ** a few zshell plugins I use:
# encode64: encode and decode base64 with e64 or d64
# extract: to extract compressed files
# sublime
# colored-man-pages
# web-search
# z
<?php
namespace Frontend;
use Common\Cache\CacheLayer;
use Common\City\Entity\City;
use Common\City\Service\CityService;
use Common\CommonRoutes;
use Common\Mvc\Application;
use Fabfuel\Prophiler\Plugin\Manager\Phalcon;
@lfcipriani
lfcipriani / random.rb
Created January 14, 2015 16:00
minimal-random-select
list = %w(
name1
name2
name3
...
)
puts list[rand(list.size)]
@lfcipriani
lfcipriani / gist:c35524da6d4712ce2c64
Created January 5, 2015 23:23
Sorteio Dojo Nodebr + Twitter
"use strict";
var path = require("path");
var fs = require("fs");
var Twit = require('twit');
var rateLimiter = {};
var luckyNumber = Math.round(Math.random()*60);
var re = /\d+/;
var oauth = JSON.parse(fs.readFileSync("./config/twitter_credentials.js", "UTF8"));
@lfcipriani
lfcipriani / sample_output
Last active August 29, 2015 14:10
Curated tweet to Permalink
ID: 536844296578940928
Created at: Mon Nov 24 11:30:29 +0000 2014
Text: @Wonderm00n epá, é o q está por default na tua api do twitter :P
User: espaco99
Permalink: https://twitter.com/espaco99/status/536844296578940928
@lfcipriani
lfcipriani / bot.rb
Created March 6, 2014 20:17
Minimal Twitter Bot in Ruby 2.x
# This bot reply "Yes", "No" or "Maybe" for tweets with questions
# Just config this script with your OAuth keys and execute it (for tokens check apps.twitter.com)
# Also make sure to install these gems
require "rubygems"
require "tweetstream"
require "em-http-request"
require "simple_oauth"
require "json"
require "uri"
<items>
<item uid="GET search/tweets" arg="https://dev.twitter.com/docs/api/1.1/get/search/tweets"><title>GET search/tweets</title><subtitle>/docs/api/1.1/get/search/tweets</subtitle></item>
<item uid="GET users/search" arg="https://dev.twitter.com/docs/api/1.1/get/users/search"><title>GET users/search</title><subtitle>/docs/api/1.1/get/users/search</subtitle></item>
<item uid="GET saved_searches/list" arg="https://dev.twitter.com/docs/api/1.1/get/saved_searches/list"><title>GET saved_searches/list</title><subtitle>/docs/api/1.1/get/saved_searches/list</subtitle></item>
<item uid="GET saved_searches/show/:id" arg="https://dev.twitter.com/docs/api/1.1/get/saved_searches/show/%3Aid"><title>GET saved_searches/show/:id</title><subtitle>/docs/api/1.1/get/saved_searches/show/%3Aid</subtitle></item>
<item uid="POST saved_searches/create" arg="https://dev.twitter.com/docs/api/1.1/post/saved_searches/create"><title>POST saved_searches/create</title><subtitle>/docs/api/1.1/post/saved_searches/create</subtitle></item>
<
$ echo "<items>"; \
> curl http://apify.heroku.com/api/twitter_rest_api_v11_docs.json | \
> jq -r '.[] | "<item uid=\"\(.resource)\" arg=\"\("https://dev.twitter.com" + .link)\"><title>\(.resource)</title><subtitle>\(.link)</subtitle></item>"' | \
> grep 'uid=".*search.*" arg' ; \
> echo "</items>"