Skip to content

Instantly share code, notes, and snippets.

View andrealmar's full-sized avatar
🏠
Working from home

Andre Almar andrealmar

🏠
Working from home
View GitHub Profile
from __future__ import absolute_import, unicode_literals
from celery import current_app
from celery.bin import worker
if __name__ == '__main__':
app = current_app._get_current_object()
worker = worker.worker(app=app)
"""
This code snippet do the following:
- It grabs the last 100 tweets from 10 users
- saves the tweets in .csv format inside the CSV directory (it creates the CSV directory if it not exists)
"""
import sys, os
import csv
import tweepy
from tweepy import OAuthHandler
def imprime_primeiro_item(lista_de_items):
print(lista_de_items[0])
FROM ubuntu
MAINTAINER Andre Almar <[email protected]>
# Add the PostgreSQL PGP key to verify their Debian packages.
# It should be the same key as
# https://www.postgresql.org/media/keys/ACCC4CF8.asc
RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8
# Add PostgreSQL's repository. It contains the most recent stable release
package controllers;
import com.jcraft.jsch.ChannelExec;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.Session;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.util.HashMap;
package controllers;
import oi.siebel.Control; //that's the Class I created to send the SSH commands to an UNIX shell
import play.mvc.Controller;
import play.mvc.Result;
import java.util.*;
import java.lang.*;
public class Application extends Controller {
#This are the proxy settings we use for activator
# Multiple proxy hosts can be used by separating them with a '|' sign
# Do not enclose the proxy host(s) in quotes
-Dhttp.proxyHost=99.99.99.99 - your proxy IP/host
-Dhttp.proxyPort=82 - your proxy PORT
-Dhttps.proxyHost=99.99.99.99 - your proxy IP/host
-Dhttps.proxyPort=82 - your proxy PORT
# Here we configure the hosts which should not go through the proxy. You should include your private network, if applicable.
import os
import glob
import sys
import cx_Oracle
row_id = raw_input("Enter ROW_ID: ")
row_id = str(row_id)
SQL = '''
>>> x = [1, 2, 3, 4, 5, 6, 6, 8]
>>> x
[1, 2, 3, 4, 5, 6, 6, 8]
>>> generator_expression = (i for i in x)
>>> generator_expression
<generator object <genexpr> at 0x101812af0>
>>> list_comprehension = [i for i in x]
>>> list_comprehension
[1, 2, 3, 4, 5, 6, 6, 8]
>>>
generator_expression = (1,2,3,4,5,6,7,8)