Skip to content

Instantly share code, notes, and snippets.

View mourdok's full-sized avatar

Andre Moreira mourdok

View GitHub Profile
@mourdok
mourdok / AlarmProbe.java
Created January 21, 2015 16:56
Creating CA Nimsoft Alarm by Java API.
//#################################################################
//# CodeWizard: Java
//# This code was generated with the Nimsoft CodeWizard version 1.70
//# Date: terça-feira, 20 de janeiro de 2015
//
package example;
import java.io.IOException;
import java.net.InetAddress;
@mourdok
mourdok / help_information.js
Created November 28, 2014 13:07
Auto expand Help Information feature on ServiceNow Survey
function onLoad() {
jQuery('a[onclick*="toggle"]:has(img)').each(function(){
jQuery(this).click();
});
}
window.onload = onLoad();
@mourdok
mourdok / extract-conditions.js
Last active December 21, 2015 21:18
#ServiceNow #TipsTricks
copy(g_form.getValue("query").replace(/\^/g, "^\n").replace(/OR/g, "\tOR"))
@mourdok
mourdok / loteria.sh
Created October 22, 2011 02:35
Resultado da Loteria Federal
clear && perl lwp-simple.pl
@mourdok
mourdok / gist:1300163
Created October 20, 2011 01:22
Send email by GMail
#!/usr/local/ActivePerl-5.14/bin/perl -w
#
# Send email by GMail
#
# Libs
use Net::SMTP::TLS;
# Main
@mourdok
mourdok / gist:706050
Created November 19, 2010 02:27
API Service-now eg.1
require 'rubygems'
require 'net/https'
require 'xmlsimple'
require 'ap'
USERNAME, PASSWORD = 'admin', 'admin'
@http = Net::HTTP.new 'demo.service-now.com', 443
@http.use_ssl = true
@mourdok
mourdok / gist:575805
Created September 12, 2010 03:19
Simple Xls to Html Converter
# To use this application, you need to install the following and specify RubyGem
# >> sudo gem install roo -v 1.3.11
# Which should return something like
# >> Successfully installed ruby-ole-1.2.10.1
# >> Successfully installed spreadsheet-0.6.4.1
# >> Successfully installed GData-0.0.4
# >> Successfully installed roo-1.3.11
# >> 4 gems installed
@mourdok
mourdok / gist:514670
Created August 8, 2010 22:58
Nginx Tip
# Nginx Tip
# Start Server
sudo /opt/nginx/sbin/nginx
# Stop Server
sudo /opt/nginx/sbin/nginx -s stop
# Restart Server
sudo /opt/nginx/sbin/nginx -s reload
@mourdok
mourdok / gist:499455
Created July 29, 2010 22:50
Correcting the mistake Spec::Expectations::ExpectationNotMetError in Culerity
# How to solve a small problem rubygem Culerity
# Want to return false results below:
# expected exist? to return true, got false (Spec::Expectations::ExpectationNotMetError)
# Located in: #{RAILS_ROOT}/features/step_definitions/culerity_steps.rb
# We have from the line 148 that:
Then /I should see "([^\"]*)"/ do |text|
# if we simply check for the browser.html content we don't find content that has been added dynamically, e.g. after an ajax call
div = $browser.div(:text, /#{Regexp::escape(text)}/)
div.should be_exist
@mourdok
mourdok / gist:498516
Created July 29, 2010 16:03
11 coisas que estudantes não aprenderiam na escola

11 coisas que estudantes não aprenderiam na escola.

Acredito nas palavras abaixo, os pais devem dar mais limites e responsabilidades aos seus filhos por pior que pareça. A vida pode ser cruel, e a crueldade pode atingir qualquer um, principalmente aqueles que não tem os pés firmes no chão.

Para qualquer pessoa com filhos de qualquer idade ou qualquer pessoa que já foi criança, aqui estão alguns conselhos de Bill Gates em uma conferência de uma escola secundária sobre 11 coisas que estudantes não aprenderiam na escola. Ele fala sobre como a política do "sentir-se bem" tem criado uma geração de crianças sem conceito da realidade e como esta política tem levado as pessoas a falharem em suas vidas posteriores à escola (não é à-toa que ele é um dos homens mais bem sucedidos e ricos do mundo).

Regra 1:

A vida não é fácil - acostume-se com isso.