Skip to content

Instantly share code, notes, and snippets.

View libotti's full-sized avatar

Robert Libotti libotti

View GitHub Profile
@libotti
libotti / move-user-profiles.ps1
Created July 16, 2022 07:56
Move all windows userprofiles from C:\USERS to D:\Users
$ProfilePaths = Get-ChildItem "REGISTRY::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" |
Where-Object {$_.Name -match "^S-1-5-21*"} |
Select-Object -ExpandProperty Name -Skip 1 | Foreach {
(Get-ItemProperty "REGISTRY::$($_)" -Name "ProfileImagePath").ProfileImagePath
}
$ProfilePaths = $ProfilePaths | Where-Object {$_ -ne "C:\Users\$($env:Username)"}
$ProfilePaths | Foreach {
$Current = "$_"
$Move = $_ -replace "^C:","D:"
Move-Item -Path "$Current" -Destination "$Move"
@libotti
libotti / program.cs
Created October 6, 2021 19:04
Consuming SSRS in .NET Core Application
using ServiceReference1;
using System;
using System.Collections.Generic;
using System.IO;
using System.ServiceModel;
using System.Threading.Tasks;
namespace SSRSSimple
{
class Program
@libotti
libotti / oracle session nls_session_parameters with trigger
Created March 22, 2021 12:37
How to set Oracle NLS_SESSION_SETTINGS WITH A TRIGGER
CREATE OR REPLACE TRIGGER sys.schema_nls_session_settings AFTER LOGON ON BOB.SCHEMA
BEGIN
execute immediate 'alter session SET NLS_TERRITORY="BRAZIL"';
execute immediate 'alter session SET NLS_LANGUAGE="BRAZILIAN PORTUGUESE"';
execute immediate 'alter session SET NLS_ISO_CURRENCY="BRAZIL"';
execute immediate 'alter session SET NLS_CURRENCY="R$"';
execute immediate 'alter session SET NLS_DATE_FORMAT="DD/MM/RR"';
execute immediate 'alter session SET NLS_DATE_LANGUAGE="BRAZILIAN PORTUGUESE"';
execute immediate 'alter session SET NLS_SORT="BINARY"';
execute immediate 'alter session SET NLS_TIME_FORMAT="HH24:MI:SSXFF"';
@libotti
libotti / overfiting.ipynb
Created March 17, 2021 21:19
overfiting.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@libotti
libotti / gist:6f9e5616653d8c51873b7b79834a95c2
Created December 20, 2020 00:26
ORACLE TABLE STATISTICS
SELECT owner usuario
,table_name tabela
,tablespace_name tablespace
,num_rows num_linhas
FROM all_tables
WHERE owner = &usuario
ORDER BY owner, table_name;
{
"workbench.colorTheme": "Omni",
"workbench.iconTheme": "material-icon-theme",
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true,
"editor.fontSize": 15,
"explorer.compactFolders": false,
"editor.renderLineHighlight": "gutter",
"workbench.editor.labelFormat": "short",
"extensions.ignoreRecommendations": true,
[user]
name = Robert Libotti
email = [email protected]
[core]
editor = code
excludesfile = ~/.gitignore_global
[push]
default = current
render() {
const {posts} = this.state;
return(
<div>
<ol className="item">
{
posts.map(post => (
<li key={post.id} align="start">
<div>
<p className="title">{post.title}</p>
public obterQuantidadeDeCreditosSelecionados(lista: Disciplina[]): number {
return lista
.filter(x => x.selecionada)
.map(x => x.credito)
.reduce((sum, current) => sum + current, 0)
}
@libotti
libotti / index.html
Created January 8, 2019 12:33
Electron Fiddle Gist
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
<!-- All of the Node.js APIs are available in this renderer process. -->
We are using Node.js <script>document.write(process.versions.node)</script>,