Skip to content

Instantly share code, notes, and snippets.

View leoramos086's full-sized avatar

Leandro Ramos de Oliveira leoramos086

View GitHub Profile
@leoramos086
leoramos086 / colorScheme.ts
Last active June 11, 2021 21:04
Vue Hook Color Scheme - Hook verifica se o ambiente esta em dark mode e adiciona um atributo 'theme-dark' no elemento html (<html theme-dark>) podendo alterna os estilos
import { reactive, readonly } from 'vue'
export interface IColorScheme {
colorScheme: 'dark' | 'light'
isDarkMode: boolean
}
const state = reactive<IColorScheme>({
colorScheme: 'light',
isDarkMode: false
@leoramos086
leoramos086 / animatedScrollTo.js
Created February 23, 2021 20:31 — forked from joshbeckman/animatedScrollTo.js
ScrollTo animation using pure javascript and no jquery
document.getElementsByTagName('button')[0].onclick = function () {
scrollTo(document.body, 0, 1250);
}
function scrollTo(element, to, duration) {
var start = element.scrollTop,
change = to - start,
currentTime = 0,
increment = 20;
@leoramos086
leoramos086 / ppt2pdf.ps1
Last active July 8, 2020 19:34 — forked from mp4096/ppt2pdf.ps1
Batch convert PowerPoint and Word files to PDF
# Batch convert all .ppt/.pptx files encountered in folder and all its subfolders
# The produced PDF files are stored in the invocation folder
#
# Adapted from http://stackoverflow.com/questions/16534292/basic-powershell-batch-convert-word-docx-to-pdf
# Thanks to MFT, takabanana, ComFreek
#
# If PowerShell exits with an error, check if unsigned scripts are allowed in your system.
# You can allow them by calling PowerShell as an Administrator and typing
# ```
# Set-ExecutionPolicy Unrestricted
@leoramos086
leoramos086 / Electron - No open two instances
Last active July 8, 2020 19:30
Códigos para Electron
var shouldQuit = app.makeSingleInstance(function(commandLine, workingDirectory) {
// Someone tried to run a second instance, we should focus our window.
if (mainWindow) {
if (mainWindow.isMinimized()) mainWindow.restore();
mainWindow.focus();
}
});
if (shouldQuit) {
app.quit();
@leoramos086
leoramos086 / gulp-connect.js
Last active April 3, 2019 23:57
Gulp multiple files
var gulp = require('gulp');
var connect = require('gulp-connect');
gulp.task('connect', function() {
connect.server({
root: 'app',
livereload: true
});
});