Skip to content

Instantly share code, notes, and snippets.

Avatar
💪
www.beat81.com

Luis Cipriani lfcipriani

💪
www.beat81.com
View GitHub Profile
@lfcipriani
lfcipriani / todoist_standup.py
Created Apr 21, 2020
Todoist Standup update generator
View todoist_standup.py
#!/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 Oct 10, 2018
terminalfred.plugin.zsh
View 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
View code.php
<?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 Jan 14, 2015
minimal-random-select
View random.rb
list = %w(
name1
name2
name3
...
)
puts list[rand(list.size)]
@lfcipriani
lfcipriani / gist:c35524da6d4712ce2c64
Created Jan 5, 2015
Sorteio Dojo Nodebr + Twitter
View gist:c35524da6d4712ce2c64
"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 Aug 29, 2015
Curated tweet to Permalink
View sample_output
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 Mar 6, 2014
Minimal Twitter Bot in Ruby 2.x
View bot.rb
# 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"
View alfred_search.xml
<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>
<
View API_doc_search.sh
$ 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>"
View link_catcher.rb