Skip to content

Instantly share code, notes, and snippets.

View gregorypilar's full-sized avatar
🎯
Focusing

Gregory Pilar gregorypilar

🎯
Focusing
View GitHub Profile
@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)
{
@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 / WIXProjectDependencies.cs
Created June 27, 2017 15:58 — forked from afranchuk/WIXProjectDependencies.cs
An MSBuild Task to automatically load project dependencies for WIX to bundle into an installer.
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Xml;
namespace BuildTasks
@gregorypilar
gregorypilar / gist:314021ee8ee8ff9e1a64beacc69fc502
Created May 17, 2017 13:49 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@gregorypilar
gregorypilar / default.reg
Created September 2, 2016 15:50 — forked from P4/default.reg
Color schemes for Windows Command Prompt
Windows Registry Editor Version 5.00
; Default color scheme
; for Windows command prompt.
; Values stored as 00-BB-GG-RR
[HKEY_CURRENT_USER\Console]
; BLACK DGRAY
"ColorTable00"=dword:00000000
"ColorTable08"=dword:00808080
; BLUE LBLUE
@gregorypilar
gregorypilar / knockoutjs-helpers.js
Created August 16, 2016 23:32 — forked from praveensewak/knockoutjs-helpers.js
A collection of KockoutJs helpers
var windowURL = window.URL || window.webkitURL;
ko.bindingHandlers.file = {
init: function (element, valueAccessor) {
$(element).change(function () {
var file = this.files[0];
if (ko.isObservable(valueAccessor())) {
valueAccessor()(file);
}
});