Skip to content

Instantly share code, notes, and snippets.

const buildPyramid = (rows, block = '𔐑') => {
for (let i = 1; i <= rows; i++) {
const spaces = ' '.repeat(rows - i);
const blocks = block.repeat(2 * i - 1);
console.log(`${spaces}${blocks}${spaces}`);
}
};
buildPyramid(5);
@michalvavra
michalvavra / ignore-all-org-repos.sh
Created May 16, 2024 13:46
Ignore all GitHub org repos
#!/usr/bin/env bash
set -eo pipefail
# Usage: sh ignore-all-org-repos.sh ORG_NAME
if ! [ -x "$(command -v gh)" ]; then
echo >&2 "Error: gh is not installed."
exit 1
fi
@michalvavra
michalvavra / htmx-spinner.html
Created March 22, 2024 15:26
HTMX Loading Spinner with SVG & CSS
<!DOCTYPE html>
<html>
<head>
<title>HTMX Loading Spinner with SVG & CSS</title>
<meta charset="utf-8">
<script src="https://unpkg.com/htmx.org@1.9.11"></script>
<link rel="stylesheet" href="https://unpkg.com/@picocss/pico@2.0.6/css/pico.classless.min.css" />
@michalvavra
michalvavra / macos-tmux-256color.md
Created August 24, 2023 16:25 — forked from bbqtd/macos-tmux-256color.md
Installing tmux-256color for macOS

Installing tmux-256color for macOS

  • macOS 10.15.5
  • tmux 3.1b

macOS has ncurses version 5.7 which does not ship the terminfo description for tmux. There're two ways that can help you to solve this problem.

The Fast Blazing Solution

Instead of tmux-256color, use screen-256color which comes with system. Place this command into ~/.tmux.conf or ~/.config/tmux/tmux.conf(for version 3.1 and later):

Keybase proof

I hereby claim:

  • I am michalvavra on github.
  • I am michalvavra (https://keybase.io/michalvavra) on keybase.
  • I have a public key ASCTKOJ0VG3_g5s8rdBzUc0XQJ2JXiNd6iaAQSlvXec5jwo

To claim this, I am signing this object:

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<aura:application>
<c:state context="{!this}" />
<force:recordData aura:id="contactRecordHandler"
layoutType="FULL"
recordId="{!state.contactId}"
targetFields="{!state.contact}"
targetError="{!state.contactErrors}"
mode="EDIT"
/>
class Foo {
static List<Contact> contacts {
get {
if (contacts == null) {
contacts = [SELECT Id FROM Contact];
}
return contacts;
}
}
static List<Some_Settings__mdt> getMockMetadaSettings() {
Some_Settings__mdt customSetting = (Some_Settings__mdt) JSON.deserialize(
JSON.serialize(new Map<String, String> {
'Label' => 'some_value',
'Field_1__c' => 'another_value',
'Field_2__c' => JSON.serialize(new Map<String, String> {
'foo' => 'boo'
})
}
// Run in Anonymous Window
Map<String, Schema.SObjectType> globalDescribe = Schema.getGlobalDescribe();
for (String objectName : globalDescribe.keyset()) {
SObjectType sObjectType = describe.get(objectName);
Schema.DescribeSObjectResult describe = sObjectType.getDescribe();
String sObjectName = String.valueOf(sObjectType.newSObject().getSobjectType());
String prefix = describe.getKeyPrefix();