Skip to content

Instantly share code, notes, and snippets.

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

Arturs Jansons iegik

🏠
Working from home
View GitHub Profile
  1. Open Automator.app
  2. Create new Quick Action
  3. Select Run AppleScript
  4. Add this:
set inputVolume to input volume of (get volume settings)
if inputVolume = 0 then
	set inputVolume to 100
	display notification "Volume set to 100" with title "✅ Microphone is on"
@gfguthrie
gfguthrie / .zshrc
Created September 27, 2019 22:02
Lazy Load Homebrew NVM but still have default aliased Node in PATH
# normal brew nvm shell config lines minus the 2nd one
# lazy loading the bash completions does not save us meaningful shell startup time, so we won't do it
export NVM_DIR="$HOME/.nvm"
[ -s "/usr/local/opt/nvm/etc/bash_completion" ] && . "/usr/local/opt/nvm/etc/bash_completion" # This loads nvm bash_completion
# add our default nvm node (`nvm alias default 10.16.0`) to path without loading nvm
export PATH="$NVM_DIR/versions/node/v$(<$NVM_DIR/alias/default)/bin:$PATH"
# alias `nvm` to this one liner lazy load of the normal nvm script
alias nvm="unalias nvm; [ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh"; nvm $@"
@fnky
fnky / ANSI.md
Last active July 22, 2024 12:03
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@heiswayi
heiswayi / EULA.md
Last active July 9, 2024 14:06
Generic desktop app EULA sample

END-USER LICENSE AGREEMENT

This End-User License Agreement (EULA) is a legal agreement between you (either as an individual or on behalf of an entity) and [[AUTHOR]] regarding your use of [[APPNAME]]'s desktop applications, and associated documentation (the "Software"). IF YOU DO NOT AGREE TO ALL OF THE TERMS OF THIS EULA, DO NOT INSTALL, USE OR COPY THE SOFTWARE.

Summary

  • You must agree to all of the terms of this EULA to use this Software.
  • If so, you may use the Software for free and for any lawful purpose.
  • This Software automatically communicates with its server for three reasons: (1) to receive and install updates; (2) to send error reports; and (3) to send anonymized usage information. You can view sample data to see what information is sent, and you may opt out of sending the anonymized usage data.
  • This Software is provided "as-is" with no warranties, and you agree that [[AUTHOR]] is not liable for anything you do with it.
@adriansr
adriansr / svg2icns.sh
Created February 19, 2018 15:21
Convert SVG file to macOS icon (icns) format
#!/bin/sh -x
set -e
SIZES="
16,16x16
32,16x16@2x
32,32x32
64,32x32@2x
128,128x128
@cecilemuller
cecilemuller / launch.json
Last active July 22, 2024 05:49
Run ts-node in VSCode Debugger
{
"version": "0.2.0",
"configurations": [
{
"name": "Example",
"type": "node",
"request": "launch",
"runtimeExecutable": "node",
"runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"],
@itsMapleLeaf
itsMapleLeaf / styled-components-override-style.jsx
Last active December 25, 2017 09:45
My preferred way of doing style overrides in styled-components
const Button = styled.button`
border: 1px solid black;
${props => props.primary && primaryStyle};
${props => props.danger && dangerStyle};
${props => props.warning && warningStyle};
`
const primaryStyle = css`
color: white;
background: blue;
@PhilippeVay
PhilippeVay / grep-svg-viewbox.txt
Created November 17, 2017 11:14
SVG parsing: display viewBox dimensions
# In a directory full of SVG files, extract and display values of their viewBox
# 1/2 Rough display
grep -H -o -i --color -E 'viewbox="([0-9. ]+)?"' *.svg
# Output:
# uEA01-arrow-down.svg:viewBox="0 0 50 50"
# uEA02-arrow-left.svg:viewBox="0 0 50 50"
# 2/2 Better display (no more color highlighting with Git Bash on Win 10 though)
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active July 22, 2024 06:03
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@kitmenke
kitmenke / finderrors.ps1
Created August 1, 2016 02:45
Working in progress: powershell script to automatically fix DCOM errors which show up in the event log
# Get-EvengLog doesn't quite work I guess:
# https://stackoverflow.com/questions/31396903/get-eventlog-valid-message-missing-for-some-event-log-sources#
# Get-EventLog Application -EntryType Error -Source "DistributedCOM"
# The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID
#$logs = Get-EventLog -LogName "System" -EntryType Error -Source "DCOM" -Newest 1 -Message "The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID*"
# 2 is error
# 3 is warning
$EVT_MSG = "The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID"
# Search for System event log ERROR entries starting with the specified EVT_MSG
$logEntry = Get-WinEvent -FilterHashTable @{LogName='System'; Level=2} | Where-Object { $_.Message -like "$EVT_MSG*" } | Select-Object -First 1