Skip to content

Instantly share code, notes, and snippets.

View tiomoreno's full-sized avatar
🎯
Focusing

Tio Moreno tiomoreno

🎯
Focusing
View GitHub Profile
@tiomoreno
tiomoreno / main.py
Created November 24, 2020 22:24
main.py
# Trazer um uuid do httpbin com uma mensagem padrão.
# Caso de sucesso:
# Deve retornar "New uuid generated by httpbin: 04ea103d-bf5a-4b6b-be92-ba53538b1815"
# Restrições trazer o uuid de uma resposta do httpbin
# Caso o httpbin responda com 404 então deve retornar uma mensagem de erro:
# HTTPBin Request Error
# Caso o httpbin responda com error de servidor ou seja entre 500 e 599
# HTTPBin Server Error
import requests
@tiomoreno
tiomoreno / LisSuite.scala
Created May 29, 2020 21:39
LisSuite.scala
package example
import java.util.NoSuchElementException
import org.junit._
/**
* This class implements a JUnit test suite for the methods in object
* `Lists` that need to be implemented as part of this assignment. A test
* suite is simply a collection of individual tests for some specific
@tiomoreno
tiomoreno / Lists.scala
Created May 29, 2020 21:32
Lists.scala
package example
import java.util.NoSuchElementException
object Lists {
/**
* This method computes the sum of all elements in the list xs. There are
* multiple techniques that can be used for implementing this method, and
* you will learn during the class.
@tiomoreno
tiomoreno / kmskeys.txt
Created March 12, 2018 18:47
Kms Keys
Windows.10.and.Office.2016.gVLK
#####################################################################
# Install/Uninstall keys #
#####################################################################
1.) Uninstall the current product by entering the “uninstall product key” extension:
slmgr.vbs /upk
2.) Install the key that you obtained above for “Windows Srv 2012R2 DataCtr/Std KMS for Windows 10”
@tiomoreno
tiomoreno / translate-srt.py
Created April 2, 2017 18:19 — forked from jney/translate-srt.py
translate a srt file with google translate
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys,json,urllib
from pysrt import SubRipFile, SubRipItem
url_string = 'http://ajax.googleapis.com/ajax/services/language/'
def detect(text):
query = dict(v='1.0', q=text)
@tiomoreno
tiomoreno / not_sure.py
Created November 2, 2016 21:02
I'm not sure
import os
if os.fork():
print "Entrando no bloco if"
else:
print "Entrando no bloco else"
@tiomoreno
tiomoreno / process_name.py
Created November 2, 2016 17:18
Retornando e alterando o nome do processo atual com python. Sem utilizar libs externas.
import time
import ctypes
from ctypes.util import find_library
# Instanciando a libc
libc = ctypes.CDLL(find_library('c'))
# Setando as flags para definir e retornar o
# o nome do processo
PR_SET_NAME = 15
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@tiomoreno
tiomoreno / README.md
Last active August 29, 2015 14:28 — forked from tkhduracell/README.md
Configure Google Hangout notifications on Jenkins

Install plugins

  • instant-messaging plugin
  • Jabber notifier plugin

Jenkins > Manage Jenkins > Configure System > Jabber Notification

  • Enable Jabber Notification
  • Jabber ID: <[email protected]>
  • Password: <your password>
  • Advanced
  • Server: talk.google.com
@tiomoreno
tiomoreno / active_record_extension.rb
Last active August 29, 2015 14:24
active record extension
module ActiveRecordExtension
extend ActiveSupport::Concern
def as_json(options = {})
begin
serializer_class = "#{self.class}Serializer"
serializer_class.constantize.new(self, {root: false})
rescue LoadError => e
super(options)