Skip to content

Instantly share code, notes, and snippets.

View brunolm's full-sized avatar
🏠
Working from home

BrunoLM brunolm

🏠
Working from home
View GitHub Profile
@brunolm
brunolm / voicecommands.ahk
Created November 11, 2023 01:33
Windows Copilot commanded by voice (Cortana) WIN+F1 to toggle
#Persistent
#SingleInstance, Force
DllCall("SetThreadDpiAwarenessContext", "ptr", -3, "ptr")
SetMouseDelay, -1
; Voice Command state
toggle := false
Menu, Tray, Icon, %A_ScriptDir%\IconFalse.ico
@brunolm
brunolm / .eslintrc
Last active April 7, 2021 21:20
.eslintrc (PascalCase for react)
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
@brunolm
brunolm / base64-image.ps1
Created November 23, 2018 18:22
Powershell: Get-ImageBase64 from FILE or URL
function Get-ImageBase64([string]$file) {
if ($file -like 'http*') {
return Get-ImageBase64FromUrl($file);
}
return Get-ImageBase64FromFile($file);
}
function Get-ImageBase64FromFile(
[string]
@brunolm
brunolm / test.md
Last active November 5, 2020 02:15
aaaaaaa yo

foo bar

@brunolm
brunolm / index.ts
Last active November 6, 2017 10:49
React Redux - Action creator (prototype)
/* Prototype
- Trying to make return type of Creators include the property TYPE
*/
function createActions<T>(obj: T) {
const keys = Object.keys(obj);
return {
Creators: keys.reduce((creators, key) => {
creators[key] = (...args) => ({ type: key, ...obj[key](...args) });
return creators;
@brunolm
brunolm / Header.js
Last active August 13, 2017 21:08
react-native test example with jest
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { View, Text } from 'react-native';
export default class Header extends Component {
static propTypes = {
user: PropTypes.object,
}
render() {
return (
@brunolm
brunolm / validation-messages.md
Created July 23, 2017 20:42
UX - Field validation messages (en / pt-br)

Validation messages for form inputs

en

The {field} field is required.
The {field} field must contain a valid email address.
The {field} field must contain all valid email addresses.
The {field} field must contain a valid URL.
The {field} field must contain a valid IP.
@brunolm
brunolm / styles.css
Created July 17, 2017 22:21
Angular validation CSS Styles
.ng-invalid.ng-touched:not(:focus):not(form) { border: 1px solid red; }
.ng-untouched ~ span, :focus ~ span { display: none; }
.ng-valid ~ span { display: none; }
@brunolm
brunolm / VSDark.StorableColorTheme.ps1xml
Created April 26, 2017 00:05
Powershell ISE VS Dark Theme
<?xml version="1.0" encoding="utf-16"?>
<StorableColorTheme xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Keys>
<string>ErrorForegroundColor</string>
<string>ErrorBackgroundColor</string>
<string>WarningForegroundColor</string>
<string>WarningBackgroundColor</string>
<string>VerboseForegroundColor</string>
<string>VerboseBackgroundColor</string>
<string>DebugForegroundColor</string>
@brunolm
brunolm / update-sqlectron.sh
Created December 14, 2016 19:30
Update SQLEctron
update-sqlectron() {
local x=$(curl -s https://github.com/sqlectron/sqlectron-gui/releases | grep '/sqlectron/sqlectron-gui/releases/tag/' | head -n 1 | awk -F "[><]" '{print $3}' | head -n 2 | sed 's,v,,g')
curl -L "https://github.com/sqlectron/sqlectron-gui/releases/download/v$x/Sqlectron-$x.deb" > /tmp/sqlectron.deb
sudo dpkg -i /tmp/sqlectron.deb && sudo apt install -f
}