Skip to content

Instantly share code, notes, and snippets.

@thiagotpc
thiagotpc / Nova Pasta.bat
Created October 21, 2015 18:39
Envia os arquivos selecionados para uma nova pasta.
@echo off
set /p novapasta= "Nome para nova pasta: "
mkdir "%novapasta%"
set newpath="%novapasta%"
:again
if {%1}=={} goto :EOF
move %1 %newpath%
shift
goto again
Echo on
@thiagotpc
thiagotpc / gmaps-get-city-and-country.js
Last active February 28, 2016 13:19
function to get city and country names from JSON results in GMaps Service
function getCity(GMapsResult) {
var localidade="";
if (GMapsResult.hasOwnProperty("results")) {
for (var prop in GMapsResult.results) {
if ((GMapsResult.results.hasOwnProperty(prop)) && (localidade==="")) {
if (GMapsResult.results[prop].hasOwnProperty("address_components")) {
var address_components = GMapsResult.results[prop].address_components;
for (var prop2 in address_components) {
if ((address_components.hasOwnProperty(prop2)) && (localidade==="")) {
var address_components_details = address_components[prop2];
@thiagotpc
thiagotpc / array-methods-to-nodelist.js
Created February 28, 2016 13:57
Add array methods to NodeList
var arrayMethods = Object.getOwnPropertyNames( Array.prototype );
arrayMethods.forEach( attachArrayMethodsToNodeList );
function attachArrayMethodsToNodeList(methodName)
{
if(methodName !== "length") {
NodeList.prototype[methodName] = Array.prototype[methodName];
}
}
@thiagotpc
thiagotpc / listInstalledSoftwares.wsh
Created July 25, 2016 15:17
get list installed software on windows
Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Format-Table –AutoSize