Skip to content

Instantly share code, notes, and snippets.

@kirillshevch
kirillshevch / rails_new_options_help.md
Last active April 28, 2024 02:27
List of "rails new" options to generate a new Rails 7 application

Run rails new --help to see all of the options you can use to create a new Rails application:

Output for Rails 7+

Usage:
  rails new APP_PATH [options]

Options:
      [--skip-namespace], [--no-skip-namespace]              # Skip namespace (affects only isolated engines)
@Klerith
Klerith / configurar-node-ts.md
Last active April 28, 2024 02:26
Node con TypeScript - TS-Node-dev simplificado

Node con TypeScript - TS-Node-dev (preferido)

  1. Instalar TypeScript y demΓ‘s dependencias
npm i -D typescript @types/node ts-node-dev rimraf
  1. Inicializar el archivo de configuraciΓ³n de TypeScript ( Se puede configurar al gusto)
npx tsc --init --outDir dist/ --rootDir src
@torque
torque / stripiT.rb
Last active April 28, 2024 02:22
Script to strip various iTunes atoms from purchased AAC files via AtomicParsley.
#!/usr/bin/env ruby
# usage: stripiT.rb file1.m4a file2.m4a file3.m4a
# automatically outputs to file1 - stripped.m4a, file2 - stripped.m4a, and so on.
# Script to remove extraneous/unwanted atoms from iTunes purchased files by way of AtomicParsley.
# Output should be comparable to the atoms left over after reencoding the file in iTunes itself.
# I only care about songs, so I have no clue how well this applies to video files
# Some information taken from: https://code.google.com/p/mp4v2/wiki/iTunesMetadata
@rxaviers
rxaviers / gist:7360908
Last active April 28, 2024 02:21
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
# In order to use this you need to increase max_extrude_cross_section in your extruder config or klipper will complain. I set mine to 30
[gcode_macro PURGE_BLOB]
gcode:
# This is for a 300mm bed. If you have a diferent bed size you may want to adjust the line below
{% set rand_pos = (105 + ( printer.system_stats.cputime * 1000 ) % 60) %} ; Generate pseudo random start pos so we dont wear out that one spot on the bed.
M117 Purging at X{ rand_pos }
# The start pos will be within the "handle" of the flex plate where there is some extra Y space available so we can go all the way to Y0
# If your setup does not have this extra space then just increase the y valie in the line "G1 X{ rand_pos } Y0 Z1 F18000"
G92 E0 ; zero the extruder

Automate LetsEncrypt certificate deployment in SecurityOnion

Prerequisites

Turn on user certs in Security Onion (do this only once)

  1. Administration -> Configuration
  2. Options -> Show all configurable settings, including advanced settings
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 28, 2024 02:14
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@mmartinjoo
mmartinjoo / devops-with-laravel-toc.md
Last active April 28, 2024 02:14
DevOps with Laravel Table of Contents

Topics coming in the next edition:

  • βœ… Load balancers from scratch (published on 10th of October)
  • βœ… Terraform (published on 12th of November)
  • HELM

Fundamentals - 208 pages (Basic package)

Building a pipeline

nginx

  • Serving static content
  • CGI, FastCGI, php-fpm
@arkatsy
arkatsy / zustand-internals.jsx
Last active April 28, 2024 02:13
How zustand works internally
import { useSyncExternalStore } from "react";
// For more on the useSyncExternalStore hook, see https://react.dev/reference/react/useSyncExternalStore
// The code is almost identical to the source code of zustand, without types and some features stripped out.
// Check the links to see the references in the source code.
// The links are referencing the v5 of the library. If you plan on reading the source code yourself v5 is the best way to start.
// The current v4 version contains lot of deprecated code and extra stuff that makes it hard to reason about if you're new to this.
// https://github.com/pmndrs/zustand/blob/fe47d3e6c6671dbfb9856fda52cb5a3a855d97a6/src/vanilla.ts#L57-L94
function createStore(createState) {

Install MSYS2 with Git for Windows and build tools

  1. Install MSYS2.
  2. After installation in opened terminal add Git for Windows repos to /etc/pacman.conf:
    cat << EOF >> /etc/pacman.conf
    
    [git-for-windows]
    Server = https://wingit.blob.core.windows.net/x86-64