Skip to content

Instantly share code, notes, and snippets.

@gwpantazes
gwpantazes / How to Install JDK MacOS Homebrew.md
Last active April 18, 2024 21:43
How to install different JDK versions on MacOS with Homebrew

How To Install Different JDK Versions on MacOS with Homebrew

Keywords: Java, JDK (Java Development Kit), MacOS, Homebrew, Specific Version

This how-to guide covers how to install different versions of the JDK on MacOS with Homebrew.

Table of Contents

@Klerith
Klerith / templateSlice.js
Last active April 18, 2024 21:44
Cascaron para crear Redux Slices rápidamente
import { createSlice } from '@reduxjs/toolkit';
export const templateSlice = createSlice({
name: 'name',
initialState: {
counter: 10
},
reducers: {
increment: (state, /* action */ ) => {
//! https://react-redux.js.org/tutorials/quick-start
@techthoughts2
techthoughts2 / python.json
Last active April 18, 2024 21:42
Collection of Python Snippets for VSCode
{
"if": {
"prefix": "if",
"body": ["if ${1:expression}:", "\t${2:pass}"],
"description": "Code snippet for an if statement"
},
"if/else": {
"prefix": "if/else",
"body": ["if ${1:condition}:", "\t${2:pass}", "else:", "\t${3:pass}"],
"description": "Code snippet for an if statement with else"
@mfurlend
mfurlend / composer.json
Last active April 18, 2024 21:41
composer require git repository
{
"name": "my_vendor_name/my_package",
"description": "My Package Description",
"license": "GPL-3.0",
"autoload": {
"classmap": [ // search these directories for classes
"lib/"
]
},
"repositories": {
@johnvey
johnvey / gist:3442925
Created August 23, 2012 22:44
This is bash script that ensures that ssh-agent is always loaded when you log in. It will reuse any existing agents in your session, thus avoiding spawning one on every terminal session.
# Place this in your .bash_profile for interactive-only support,
# or in .bashrc for interactive and non-interactive support.
#
# See: https://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Git#SetupSSHforGit-installpublickey
SSH_ENV="$HOME/.ssh/environment"
# start the ssh-agent
function start_agent {
echo "Initializing new SSH agent..."
@drmalex07
drmalex07 / getopt-example.sh
Last active April 18, 2024 21:39
A small example on Bash getopts. #bash #getopt #getopts
#!/bin/bash
#
# Example using getopt (vs builtin getopts) that can also handle long options.
# Another clean example can be found at:
# http://www.bahmanm.com/blogs/command-line-options-how-to-parse-in-bash-using-getopt
#
aflag=n
bflag=n
@devomman
devomman / office-activation.md
Created May 30, 2023 11:01
Office Activation Command by Omman

Office 2021

Method 1: Using my command line

Step 1.1: Open cmd program with administrator rights.

  • First, you need to open cmd in the admin mode, then run all commands below one by one.

Step 1.2: Get into the Office directory in cmd.

  • For x86 and x64
cd /d %ProgramFiles(x86)%\Microsoft Office\Office16
cd /d %ProgramFiles%\Microsoft Office\Office16
@akpoff
akpoff / curl_imap_query_commands.md
Created January 2, 2018 17:29
curl commands to query imap servers

curl commands to query imap servers

Based on https://busylog.net/telnet-imap-commands-note/

curl options

  • -k -- don't verify certificate (optional)
  • -n -- use .netrc for username and password (optional)
  • -X -- request to send to server
@Kulbear
Kulbear / gather_nd_pytorch.py
Created June 21, 2022 08:45
A PyTorch porting of tensorflow.gather_nd with batch_dim supported.
import torch
import tensorflow as tf
import time
import numpy as np
def gather_nd_torch(params, indices, batch_dim=1):
""" A PyTorch porting of tensorflow.gather_nd
This implementation can handle leading batch dimensions in params, see below for detailed explanation.
@insertish
insertish / React Native.md
Last active April 18, 2024 21:28
Configure React Native with Typescript, Vite.js for react-native-web and Storybook.