Skip to content

Instantly share code, notes, and snippets.

View xixiaofinland's full-sized avatar

Xi Xiao xixiaofinland

View GitHub Profile
@LukeMathWalker
LukeMathWalker / audit.yml
Last active September 20, 2024 01:47
GitHub Actions - Rust setup
name: Security audit
on:
schedule:
- cron: '0 0 * * *'
push:
paths:
- '**/Cargo.toml'
- '**/Cargo.lock'
jobs:
security_audit:
@Mefistophell
Mefistophell / RUST.MD
Last active September 12, 2024 21:57
How to Compile a Rust Program on Mac for Windows

Question: I want to compile my Rust source code for the Windows platform but I use macOS.

Solution:

  1. Install target mingw-w64: brew install mingw-w64
  2. Add target to rustup: rustup target add x86_64-pc-windows-gnu
  3. Create .cargo/config
  4. Add the instructions below to .cargo/config
[target.x86_64-pc-windows-gnu]
@tstachl
tstachl / .eslintrc.json
Last active April 24, 2018 12:41
Sane default eslintrc close to Salesforce DX.
{
"env": {
"browser": true
},
"parserOptions": {
"ecmaVersion": 5
},
"globals": {
"$A": true,
"AuraContext": true,
@9bitbear
9bitbear / _MONERO-mining-ubuntu16.04.md
Last active March 22, 2021 10:45
XMR mining on Ubuntu
@xixiaofinland
xixiaofinland / sfdx-cheatsheet.sh
Last active March 28, 2024 18:54
Salesforce SFDX Cheat Sheet
# Proudly supplied by Salesforce Way Site: https://salesforceway.com
# This cheatsheet contains the most often used SFDX commands for beginners to get a jumpstart.
# Hint. it is highly recommended to use `-h` to check the usage of any SFDX commands and corresponding parameters.
# For instance, use `sfdx force:auth:web:login -h` to checke what `-d` `-a` parameters do
# List down all supported dx commands:
sfdx force:doc:commands:list
# Check current DebHub and Scratch Org status
sfdx force:org:list
export ORG_ALIAS='DummyScratchOrg'
export PROJECT_NAME='DummyProject'
export PERMISSION_SET='DummyPermSet'
export IMPORT_PLAN='Dummy-plan.json'
# Create a Salesforce DX project
sfdx force:project:create -n $PROJECT_NAME
# Regist development/sandbox org
sfdx force:auth:web:login [-d] -a $ORG_ALIAS
@tobias
tobias / setjdk.fish
Created July 12, 2016 18:16
Manage multiple java versions on the mac from the fish shell
function setjdk
if test -n "$JAVA_HOME"
removeFromPath "$JAVA_HOME/bin"
end
set -gx JAVA_HOME (/usr/libexec/java_home -v $argv[1])
set -gx PATH $JAVA_HOME/bin $PATH
end
function removeFromPath
set -l idx 0
@TheBB
TheBB / loading.org
Last active June 22, 2023 11:53
Loading in Spacemacs

Emacs packages, features, files, layers, extensions, auto-loading, require, provide, use-package… All these terms getting you confused? Let’s clear up a few things.

Files

Emacs files contains code that can be evaluated. When evaluated, the functions, macros and modes defined in that file become available to the current Emacs session. Henceforth, this will be termed as loading a file.

One major problem is to ensure that all the correct files are loaded, and in the

@nolanlawson
nolanlawson / protips.js
Last active August 22, 2024 14:19
Promise protips - stuff I wish I had known when I started with Promises
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");
@staltz
staltz / introrx.md
Last active September 20, 2024 10:10
The introduction to Reactive Programming you've been missing