Skip to content

Instantly share code, notes, and snippets.

View certainlyakey's full-sized avatar

Aleksandr Beliaev certainlyakey

  • Nortal AS
  • Tallinn
View GitHub Profile
@zats
zats / REMAP_M1_KEYS.MD
Last active December 23, 2023 20:32
Apple M1 MacBook Do Not Disturb Key remapping

Following is a sample of LaungAgent that remaps do not disturb key to Siri (I am using Type to Siri)

This is a lightweight solution not relying on external apps.

Setting up

  1. Create ~/Library/LaunchAgents/com.local.KeyRemapping.plist
  2. Edit it to have following content
@iraghumitra
iraghumitra / streamline-icon.component.html
Last active June 1, 2021 06:00
Streamline Icons Angular
<span [innerHTML]="svgContent" (click)="onClick($event)" [ngClass]="(fill.length > 0 || stroke.length > 0) ? '' : 'icon-bg'" #element></span>
@buckleyc
buckleyc / ReMap Keys on MacOS.md
Last active January 1, 2024 06:30
ReMap Keys on MacOS

This article describes how to quickly and easily remap your MacOS keyboard to better suit your needs using only the command line (i.e., without needing to install any additional applications).

TL;DR: Enter the following command in a terminal on your Mac to remap Caps-Lock as Delete, and remap Delete as Escape:

hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x70000002A,"HIDKeyboardModifierMappingDst":0x700000029},{"HIDKeyboardModifierMappingSrc":0x700000039,"HIDKeyboardModifierMappingDst":0x70000002A}]}'

But why would you want to do this? A couple of quick examples targeted at writers or developers: If you are using a modern IDE or code editor (versus 'vim' or 'emacs'), then you may wish to map the very convenient but seldom-used Caps-Lock to the oft-used Delete function. Or if you are editing using vim or emacs, then you may wish to map the Caps-Lock to a commonly-used modifier key such as Ctrl. Or maybe you are just a normal person that tends to not type many acronyms

@kctang
kctang / tailwind-angular
Created October 25, 2020 02:53
Tailwind CSS support in Angular 10, with Angular Material
Index: client/angular.json
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- client/angular.json (revision fcfaf7440d0eaed6baa841b2b4d9eca231b002f6)
+++ client/angular.json (date 1603593891228)
@@ -39,7 +39,7 @@
"prefix": "app",
"architect": {
@rockaBe
rockaBe / auto-node-version-switch.sh
Last active June 16, 2023 10:09
Auto loading node version using fnm from .nvmrc or .node-version file in the current folder
# ZSH
autoload -U add-zsh-hook
# place default node version under $HOME/.node-version
load-nvmrc() {
DEFAULT_NODE_VERSION=`cat $HOME/.node-version`
if [[ -f .nvmrc && -r .nvmrc ]] || [[ -f .node-version && -r .node-version ]]; then
fnm use
elif
[[ `node -v` != $DEFAULT_NODE_VERSION ]]; then
@ivandoric
ivandoric / gulpfile.js
Last active September 18, 2022 18:14
Adding Svelte To Your Website Using Gulp and Webpack
// This is the code used in video "How To Add Svelte To Your Site?"
// Check out the video here: https://www.youtube.com/watch?v=ZL7mKFQHSAY
const gulp = require('gulp')
const sass = require('gulp-sass')
const browsersync = require('browser-sync').create()
const webpack = require('webpack')
const webpackStream = require('webpack-stream')
@aaemnnosttv
aaemnnosttv / gravity-forms-select-optgroupify.php
Created October 5, 2018 09:58
GravityForms filter to allow for grouping select choices into labelled groups using special choice options.
<?php
/**
* Filter for GravityForms to group select field choices by a special "optgroup" choice.
*
* Simply add a new choice with a value of 'optgroup' to the dropdown to start a group of options.
* All following choices will be grouped under it using its label for the group.
* Any number of groups can be created, as each optgroup choice will start a new group.
* Supports field placeholder & ungrouped options, but must be before the first group.
*
* This snippet can be added to your theme's functions.php, or a custom plugin.
@onildoaguiar
onildoaguiar / sorting-an-array-by-date-with-moment-js.md
Last active July 21, 2023 04:28
Sorting an array by date with Moment.js
const Moment = require('moment')
const array = [{date:"2018-05-11"},{date:"2018-05-12"},{date:"2018-05-10"}]
const sortedArray  = array.sort((a,b) => new Moment(a.date).format('YYYYMMDD') - new Moment(b.date).format('YYYYMMDD'))
console.log(sortedArray)
@jacklorusso
jacklorusso / workbench.colorCustomizations.json
Last active December 19, 2023 07:40
A list of all Visual Studio Code customizable colors, grouped by UI region. Copy and paste into User Settings (comments are allowed) to tweak an existing theme or work on your own.
"workbench.colorCustomizations": {
// Contrast Colors - The contrast colors are typically only set for high contrast themes. If set, they add an additional border around items across the UI to increase the contrast.
"contrastActiveBorder": "",
"contrastBorder": "",
// Base Colors
"focusBorder": "",
"foreground": "",
"widget.shadow": "",
"selection.background": "",
"descriptionForeground": "",
@stianandreassen
stianandreassen / acf_wysiwyg_height.php
Last active January 24, 2022 22:35
Add a height field to ACF WYSIWYG Field
<?php
/**
* Add height field to ACF WYSIWYG
*/
function wysiwyg_render_field_settings( $field ) {
acf_render_field_setting( $field, array(
'label' => __('Height of Editor'),
'instructions' => __('Height of Editor after Init'),
'name' => 'wysiwyg_height',
'type' => 'number',