Skip to content

Instantly share code, notes, and snippets.

View samuelcarreira's full-sized avatar

Samuel Carreira samuelcarreira

View GitHub Profile
@samuelcarreira
samuelcarreira / benchmark-processHrtime-vs-dateNow.js
Created March 21, 2020 01:20
Benchmark time subtraction: process.hrtime; process.hrtime.bigint(); Date.now()
/**
* I know that the process.hrtime as a higher precision over the
* Date constructor object so it's not a "fair" benchmark,
* but if you doesn't need a high precision timer and you just want
* to compare the fastest time subtraction this benchmark can
* be usefull
*
* Licensed under MIT
* Copyright (c) 2020 [Samuel Carreira]
*/
@samuelcarreira
samuelcarreira / index.js
Created October 30, 2018 23:45
electron-shutdown-command - removed electron/app code (maxwroc request)
'use strict';
const cp = require('child_process');
// learn more - documentation:
// windows: https://technet.microsoft.com/en-us/library/bb491003.aspx?f=255&MSPPError=-2147217396
// macos: https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man8/shutdown.8.html
// linux: https://www.computerhope.com/unix/ushutdow.htm
/**
@samuelcarreira
samuelcarreira / slacknotification.ino
Last active May 24, 2018 21:04
Inno Setup Script - Get Slack notification when someone installs your app
; Get Slack notification when someone installs your app
; by: Samuel Carreira
; -- Basic code from Inno Setup Example1.iss --
#define MyAppVersion "0.1.0"
#define MyAppName "Your App Name"
[Setup]
AppName=My Program