Skip to content

Instantly share code, notes, and snippets.

View barcellos's full-sized avatar

Fernando Barcellos barcellos

View GitHub Profile
@xixiaofinland
xixiaofinland / sfdx-cheatsheet.sh
Last active October 9, 2024 14: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
@squarism
squarism / iterm2.md
Last active April 19, 2025 04:46
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)
@mziwisky
mziwisky / Oauth2.md
Last active February 19, 2025 19:08
Oauth2 Explanation

OAUTH2

The Problem

I’m a web app that wants to allow other web apps access to my users’ information, but I want to ensure that the user says it’s ok.

The Solution

I can’t trust the other web apps, so I must interact with my users directly. I’ll let them know that the other app is trying to get their info, and ask whether they want to grant that permission. Oauth defines a way to initiate that permission verification from the other app’s site so that the user experience is smooth. If the user grants permission, I issue an AuthToken to the other app which it can use to make requests for that user's info.

Note on encryption

Oauth2 has nothing to do with encryption -- it relies upon SSL to keep things (like the client app’s shared_secret) secure.

<apex:page >
<apex:includeScript value="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.2.min.js"/>
<script>
jQuery(document).ready(function($) {
$('#queryform').submit(function(){
$.ajax($('#query').val(),
{
beforeSend: function(xhr) {
xhr.setRequestHeader('Authorization', 'Bearer {!$Api.Session_ID}');
},
@guidosabatini
guidosabatini / XCDFakeCarrier.m
Created November 13, 2012 16:33 — forked from 0xced/XCDFakeCarrier.m
Hack to choose the displayed carrier name in the iOS simulator, now working in iOS 5 and iOS 6 (with different carrier names)
//
// Copyright (c) 2012 Cédric Luthi / @0xced. All rights reserved.
//
#if TARGET_IPHONE_SIMULATOR
#define ITEMISENABLED_LENGHT_IOS5 23
#define ITEMISENABLED_LENGHT_IOS6 24
#define STATUSBARBATATYPEENCODING_IOS5 "^{?=[23c][64c]ii[100c]"
#define STATUSBARBATATYPEENCODING_IOS6 "^{?=[24c][64c]ii[100c]"
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active April 19, 2025 05:22
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx