Skip to content

Instantly share code, notes, and snippets.

View gregorypilar's full-sized avatar
🎯
Focusing

Gregory Pilar gregorypilar

🎯
Focusing
View GitHub Profile
$cert = New-SelfSignedCertificate -DnsName mydemowebapp.net -CertStoreLocation cert:\LocalMachine\My
$pwd = ConvertTo-SecureString -String "MyPassword" -Force -AsPlainText
Export-PfxCertificate -Cert $cert -FilePath C:\temp\cert.pfx -Password $pwd
#Note that you should be running PowerShell as an Administrator
[System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
$publish = New-Object System.EnterpriseServices.Internal.Publish
$publish.GacInstall("Newtonsoft.Json.dll")
@gregorypilar
gregorypilar / WordPDFConvert.cs
Created December 23, 2020 17:49 — forked from ArthurEzenwanne/WordPDFConvert.cs
C# code to convert .docx to .pdf using Microsoft.Office.Interop.Word
using System;
using Microsoft.Office.Interop.Word;
using Word = Microsoft.Office.Interop.Word;
namespace WordToPDFConsoleApp
{
class Program
{
static void Main(string[] args)
{
$params = "$env:SONARQUBE_SCANNER_PARAMS" -replace '"sonar.branch.name":"[\w/,-.]*"\,?'
Write-Host "##vso[task.setvariable variable=SONARQUBE_SCANNER_PARAMS]$params"
@gregorypilar
gregorypilar / vce.tcl
Created October 17, 2020 16:36 — forked from juster/vce.tcl
VCE Exam Taker
package require Tk
proc initTop {} {
menu .topMenu
menu .topMenu.fileMenu -tearoff 0
.topMenu.fileMenu add command -label Open... -command selectVCEPath
.topMenu add cascade -label File -menu .topMenu.fileMenu
. configure -menu .topMenu
@gregorypilar
gregorypilar / Web.config
Created September 11, 2018 21:25 — forked from alexsorokoletov/Web.config
Web.config for Azure App Services/Web Sites to allow downloading static files (withouth extension) for Electron autoupdate
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension="." mimeType="text/plain" />
<mimeMap fileExtension=".nupkg" mimeType="application/octet-stream" />
<mimeMap fileExtension=".exe" mimeType="application/octet-stream" />
<mimeMap fileExtension=".zip" mimeType="application/x-zip-compressed" />
</staticContent>
</system.webServer>
@gregorypilar
gregorypilar / App.config
Created September 11, 2018 14:21 — forked from primaryobjects/App.config
Example C# code to extract audio from YouTube and save as trimmed 15-second WAV file. Requires ffmpeg.exe
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="ffmpeg:ExeLocation" value="../../../tools/ffmpeg.exe" />
</appSettings>
</configuration>
@gregorypilar
gregorypilar / .babelrc
Created March 19, 2018 03:26 — forked from c9s/.babelrc
webpack + babel + typescript + es6 - total solutions!
{
"presets": ["es2015"],
"plugins": ["transform-runtime"]
}
@gregorypilar
gregorypilar / download-file.js
Created February 13, 2018 15:14 — forked from javilobo8/download-file.js
Download files with AJAX (axios)
axios({
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
document.body.appendChild(link);
@gregorypilar
gregorypilar / change collation.sql
Created January 12, 2018 19:58
Cambiar el collation de todos los objectos de la base de datos
DECLARE @collate nvarchar(100);
DECLARE @table nvarchar(255);
DECLARE @column_name nvarchar(255);
DECLARE @column_id int;
DECLARE @data_type nvarchar(255);
DECLARE @max_length int;
DECLARE @row_id int;
DECLARE @sql nvarchar(max);
DECLARE @sql_column nvarchar(max);
DECLARE @is_Nullable bit;