Skip to content

Instantly share code, notes, and snippets.

@elicore
elicore / kitty.md
Created April 8, 2025 17:52 — forked from pnsinha/kitty.md
Kitty CheatSheet

Default shortcuts

Scrolling

Action Shortcut
Scroll line up ctrl+shift+up (also ⌥+⌘+⇞ and ⌘+↑ on macOS)
Scroll line down ctrl+shift+down (also ⌥+⌘+⇟ and ⌘+↓ on macOS)
Scroll page up ctrl+shift+page_up (also ⌘+⇞ on macOS)
Scroll page down ctrl+shift+page_down (also ⌘+⇟ on macOS)
@elicore
elicore / grammar.md
Last active September 9, 2023 20:52
Copy of Writing a TextMate Grammar: Some Lessons Learned - https://www.apeth.com/nonblog/stories/textmatebundle.html

Writing a TextMate Grammar: Some Lessons Learned

February 17, 2014 at 14:35:46

Although TextMate has been around for a long time (in computer years) and many language bundles exist, it is startling to find that the process of writing a language grammar remains poorly documented. Having recently managed to write a grammar of my own for the first time, here are some things I learned along the way.

Time Involved

Writing a grammar can be a slow business. It took me some weeks just to prepare, collecting information and locating and studying the existing instructions and documentation.

@elicore
elicore / date.md
Created August 30, 2023 18:10
date command one liners

one-liner examples of the date command in Unix:

Print the current date and time:

date

Print the date and time 1 hour ago:

@elicore
elicore / conventional_commit_messages.md
Created February 22, 2023 14:10 — forked from qoomon/conventional-commits-cheatsheet.md
Conventional Commit Messages

Conventional Commit Messages

See how a minor change to your commit message style can make a difference. Examples

Have a look at CLI util git-conventional-commits to ensure this conventions and generate changelogs

Commit Formats

Default

@elicore
elicore / nginx_basics.md
Last active October 27, 2022 15:34 — forked from leommoore/nginx_basics.md
Nginx Basics

Nginx Basics for Ubuntu

Please see http://wiki.nginx.org/Main for more information. See http://arstechnica.com/gadgets/2012/11/how-to-set-up-a-safe-and-secure-web-server/ for a tutorial on how to install Nginx.

Installation

To install, you can install the version which is in the standard Ubuntu repositories but it is normally quite old and will not have the latest security patches. The best way is to update the repositories first:

apt-get update
apt-get install python-software-properties

apt-get upgrade

@elicore
elicore / spotlight.ps1
Created June 17, 2022 12:58
Saving Microsoft Spotlight (lock screen photos)
$save_folder = "C:\Users\my_username\Pictures\Spotlight"
$saved_names = dir $save_folder | foreach Name
$spotlight_folder = $env:LOCALAPPDATA + "\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets"
$spotlight_files = (dir $spotlight_folder)
foreach ($file in $spotlight_files) {
$saved_name = (Split-Path $file -Leaf) + ".jpg"
if ($saved_names -contains $saved_name) {
continue
// Create a kaltura session (ks) using an app token in nodejs
// First install the Kaltura client library: npm install kaltura-client
// Details from your Kaltura account: partner id (pid), apptoken id, apptoken hash
const kaltura = require('kaltura-client');
const client = new kaltura.Client(new kaltura.Configuration());
let widgetId = "_YOUR-PID";
let expiry = 86400;
var crypto = require('crypto');
@elicore
elicore / .go-my-posh-default.json
Last active January 15, 2021 15:36
Microsoft.PowerShell_profile.ps1
{
"final_space": true,
"console_title": false,
"blocks": [
{
"type": "prompt",
"alignment": "left",
"horizontal_offset": 0,
"vertical_offset": 0,
"segments": [
#verify this is the console and not the ISE
Import-Module Get-ChildItemColor
Set-Alias l Get-ChildItemColor -option AllScope
Set-Alias ls Get-ChildItemColorFormatWide -option AllScope
function ll{
return l | select Mode, @{Name="LastWriteTime"; Expression={$_.LastWriteTime.ToString("yyyy-MM-dd HH:mm")}}, @{Name='Size'; Expression={if ($_.Attributes -ne 'Directory') {$_.Length} else {''}}}, Name
}
Set-Alias dir Get-ChildItemColor -option AllScope -Force

Postgres Cheatsheet

This is a collection of the most common commands I run while administering Postgres databases. The variables shown between the open and closed tags, "<" and ">", should be replaced with a name you choose. Postgres has multiple shortcut functions, starting with a forward slash, "". Any SQL command that is not a shortcut, must end with a semicolon, ";". You can use the keyboard UP and DOWN keys to scroll the history of previous commands you've run.

Setup

installation, Ubuntu

http://www.postgresql.org/download/linux/ubuntu/ https://help.ubuntu.com/community/PostgreSQL