Skip to content

Instantly share code, notes, and snippets.

View ncesar's full-sized avatar
🎯
Focusing

César Nascimento ncesar

🎯
Focusing
View GitHub Profile
@idleberg
idleberg / vscode-macos-context-menu.md
Last active June 19, 2024 01:58
“Open in Visual Studio Code” in macOS context-menu

Open in Visual Studio Code

  • Open Automator
  • Create a new document
  • Select Quick Action
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
    • your default shell should already be selected, otherwise use /bin/zsh for macOS 10.15 (”Catalina”) or later
    • older versions of macOS use /bin/bash
  • if you're using something else, you probably know what to do 😉
@lancethomps
lancethomps / close_notifications_applescript.js
Last active June 18, 2024 19:51
AppleScript to close all notifications on macOS Big Sur, Monterey, and Ventura
function run(input, parameters) {
const appNames = [];
const skipAppNames = [];
const verbose = true;
const scriptName = "close_notifications_applescript";
const CLEAR_ALL_ACTION = "Clear All";
const CLEAR_ALL_ACTION_TOP = "Clear";
@tannerlinsley
tannerlinsley / README.md
Last active April 12, 2024 17:04
Replacing Create React App with the Next.js CLI

Replacing Create React App with the Next.js CLI

How dare you make a jab at Create React App!?

Firstly, Create React App is good. But it's a very rigid CLI, primarily designed for projects that require very little to no configuration. This makes it great for beginners and simple projects but unfortunately, this means that it's pretty non-extensible. Despite the involvement from big names and a ton of great devs, it has left me wanting a much better developer experience with a lot more polish when it comes to hot reloading, babel configuration, webpack configuration, etc. It's definitely simple and good, but not amazing.

Now, compare that experience to Next.js which for starters has a much larger team behind it provided by a world-class company (Vercel) who are all financially dedicated to making it the best DX you could imagine to build any React application. Next.js is the 💣-diggity. It has amazing docs, great support, can grow with your requirements into SSR or static site generation, etc.

So why

@mjrulesamrat
mjrulesamrat / multiple_ssh_keys.md
Last active June 11, 2024 21:09
How to Setup Multiple Ssh Keys for Multiple Github/Bitbucket accounts

How to Setup Multiple Ssh Keys for Multiple Github/Bitbucket accounts

create the SSH keys.

ssh-keygen -t rsa -b 4096 -C "mjrulesamrat@gmail.com"

Add the SSH Keys to the SSH-Agent

<?php include 'wp-load.php';
//$user = get_user_by( 'email', 'emailcadastrado@email.com' );
$user = get_user_by( 'slug', 'usuario' );
//$user = get_user_by( 'login', 'usuario' );
wp_set_password( "new_password", $user->ID );
// Just use ID=1 for the super admin account
wp_set_password( "new_password", 1 );
@bvaughn
bvaughn / index.md
Last active April 3, 2024 07:41
Interaction tracing with React

This API was removed in React 17


Interaction tracing with React

React recently introduced an experimental profiler API. After discussing this API with several teams at Facebook, one common piece of feedback was that the performance information would be more useful if it could be associated with the events that caused the application to render (e.g. button click, XHR response). Tracing these events (or "interactions") would enable more powerful tooling to be built around the timing information, capable of answering questions like "What caused this really slow commit?" or "How long does it typically take for this interaction to update the DOM?".

With version 16.4.3, React added experimental support for this tracing by way of a new NPM package, scheduler. However the public API for this package is not yet finalized and will likely change with upcoming minor releases, so it should be used with caution.

@branneman
branneman / primitive-reference-types-javascript.md
Last active May 12, 2024 03:45
Primitive Types & Reference Types in JavaScript

Primitive Types & Reference Types in JavaScript

An explanation of JavaScript's pass-by-value, which is unlike pass-by-reference from other languages.

Facts

  • JavaScript has 2 kinds of variable types: primitive and reference.
  • A fixed amount of memory is reserved after creation of every variable.
  • When a variable is copied, it's in-memory value is copied.
  • Passing a variable to a function via a call also creates a copy of that variable.

Primitive Types

@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active June 17, 2024 04:00 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@heiswayi
heiswayi / repo-reset.md
Created February 5, 2017 01:32
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
@jpcontrerasv
jpcontrerasv / ACF If Else field.php
Created August 26, 2016 04:46
ACF If Else field
<?php if ( get_field( 'field_name' ) ): ?>
This is displayed when the field_name is TRUE or has a value.
<?php else: // field_name returned false ?>
This is displayed when the field is FALSE, NULL or the field does not exist.
<?php endif; // end of if field_name logic ?>