Skip to content

Instantly share code, notes, and snippets.

View nicobao's full-sized avatar
🔨
Building Agora Citizen Network & Racine Protocol

Nicolas Gimenez nicobao

🔨
Building Agora Citizen Network & Racine Protocol
View GitHub Profile

Multiple environments

This document contains an explanation of how you can create and maintain multiple environments for your Quasar projects. It will be an expansion of the official documentation located here for Webpack and here for Vite. Bear in mind that this guide is applicable to both versions of Quasar.

1. step

Create a variables folder in the project root, with a parser.js file inside. This will allow you to have all environment related files in a single place, which will improve readability.

2. step

@DinoChiesa
DinoChiesa / convert.Java
Created October 8, 2021 17:16
Java: convert between ASN.1 and P1363 Encoding of Signature
import org.bouncycastle.asn1.ASN1EncodableVector;
import org.bouncycastle.asn1.ASN1Integer;
import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.DERSequence;
import java.math.BigInteger;
private static byte[] toP1363(byte[] asn1EncodedSignature) throws Exception {
ASN1Sequence seq = ASN1Sequence.getInstance(asn1EncodedSignature);
BigInteger r = ((ASN1Integer) seq.getObjectAt(0)).getValue();
BigInteger s = ((ASN1Integer) seq.getObjectAt(1)).getValue();
@sindresorhus
sindresorhus / esm-package.md
Last active May 5, 2025 10:05
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@rpapallas
rpapallas / instructions.md
Last active April 20, 2025 02:06
Open file into NeoVim on macOS from Finder

Create a script that will allow macOS to open a source code file in iTerm2/Terminal and Vim/NeoVim

  • Open Automator and create a new application. You can name it "TerminalVim"
  • Works with any command basically, just change the following line set q to "nvim " & quote & myPath & quote to match what you want in the code below. For example: set q to "vim " & quote & myPath & quote to use Vim instead of NeoVim.
  • Paste the following code:
on appIsRunning(appName)
    tell application "System Events" to (name of processes) contains appName
end appIsRunning
@miglen
miglen / ec2-instance-prompt.sh
Last active January 23, 2024 17:11
AWS EC2 Instance Prompt with EC2 ARN Instance Id Public IP Private IP Account Id Region and Instance Name Tag
#!/bin/bash
#
# description: EC2 Instance Prompt
# author: Miglen Evlogiev <[email protected]>
#
# deployment: copy this file into /etc/profile.d/ec2-instance-prompt.sh
# sudo wget https://gist.githubusercontent.com/miglen/e2e577b95acf1171a1853871737323ce/raw/ec2-instance-prompt.sh -P /etc/profile.d/
# sudo bash /etc/profile.d/ec2-instance-prompt.sh
#
@tmatz
tmatz / editorconfig.vim
Created April 15, 2020 16:19
coc.nvim custom source for .editorconfig (put in ~/.vim/autoload/coc/source/)
function! coc#source#editorconfig#init() abort
return {
\ filetypes: [ 'editorconfig' ]
\}
endfunction
function! coc#source#editorconfig#complete(opt, cb) abort
let items = [
\ 'charset',
\ 'end_of_line',
@ccamacho
ccamacho / howto.md
Created September 9, 2018 11:58 — forked from vranystepan/howto.md
Getting Thumbnails / Previews of your RAW files in Fedora 25

Howto

Install these programms

sudo dnf install raw-thumbnailer
sudo dnf install ufraw

Try now if everything works, and your thumbnails show up. If not, try the following part.

@Manouchehri
Manouchehri / rfc3161.txt
Last active May 1, 2025 21:58
List of free rfc3161 servers.
https://rfc3161.ai.moda
https://rfc3161.ai.moda/adobe
https://rfc3161.ai.moda/microsoft
https://rfc3161.ai.moda/apple
https://rfc3161.ai.moda/any
http://rfc3161.ai.moda
http://timestamp.digicert.com
http://timestamp.globalsign.com/tsa/r6advanced1
http://rfc3161timestamp.globalsign.com/advanced
http://timestamp.sectigo.com
@huytd
huytd / .gitconfig
Created August 4, 2016 16:26
Use neovim as diff tool
[merge]
tool = vimdiff
[mergetool]
prompt = true
[mergetool "vimdiff"]
cmd = nvim -d $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'
[difftool]
prompt = false
[diff]
tool = vimdiff
@squarism
squarism / iterm2.md
Last active May 5, 2025 10:56
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)