Skip to content

Instantly share code, notes, and snippets.

View vmsp's full-sized avatar

Vitor vmsp

View GitHub Profile
# frozen_string_literal: true
module Simpleflake
module_function
EPOCH = 946_702_800
def generate
s = ((Time.now.to_f - EPOCH) * 1000).to_i
r = SecureRandom.random_number(0..((2**23) - 1))
on run {input, parameters}
tell application "Microsoft Word"
activate
repeat with i in input
open i
--click button "Enable Macros" of window 1
set pdfFilename to my swapExt(i)
set doc to the active document
save as doc file format format PDF file name pdfFilename
close doc
@vmsp
vmsp / UnbundleTagHelper.cs
Last active November 30, 2020 11:32
BundleMinifier - Unbundle scripts during development and minify them for production in ASP.NET Core
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.Mvc.Routing;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
using Microsoft.AspNetCore.Razor.TagHelpers;
using Newtonsoft.Json;
@vmsp
vmsp / awk_oneliners
Created June 27, 2015 22:45
Handy One-Line Scripts for Awk
HANDY ONE-LINE SCRIPTS FOR AWK 30 April 2008
Compiled by Eric Pement - eric [at] pement.org version 0.27
Latest version of this file (in English) is usually at:
http://www.pement.org/awk/awk1line.txt
This file will also be available in other languages:
Chinese - http://ximix.org/translation/awk1line_zh-CN.txt
USAGE:
@vmsp
vmsp / sed_oneliners
Created June 27, 2015 22:44
Useful One-Line Scripts For Sed
-------------------------------------------------------------------------
USEFUL ONE-LINE SCRIPTS FOR SED (Unix stream editor) Dec. 29, 2005
Compiled by Eric Pement - pemente[at]northpark[dot]edu version 5.5
Latest version of this file (in English) is usually at:
http://sed.sourceforge.net/sed1line.txt
http://www.pement.org/sed/sed1line.txt
This file will also available in other languages:
Chinese - http://sed.sourceforge.net/sed1line_zh-CN.html