Skip to content

Instantly share code, notes, and snippets.

@gaquino
gaquino / gist:e41b946fd624355f37e9079a1c0792f5
Last active November 10, 2020 18:22
Setup Amazon EC2 - Java 8 + Maven
---- install Oracle JDK 1.8
$ wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u141-b15/336fa29ff2bb4ef291e347e091f7f4a7/jdk-8u141-linux-x64.rpm
$sudo yum install -y jdk-8u141-linux-x64.rpm
---- install OpenJDK
$ vi install.sh
yum install -y java-1.8.0-openjdk-devel
yum remove java-1.7.0-openjdk
wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
@chranderson
chranderson / nvmCommands.js
Last active July 22, 2026 09:25
Useful NVM commands
// check version
node -v || node --version
// list locally installed versions of node
nvm ls
// list remove available versions of node
nvm ls-remote
// install specific version of node
@Sunil02kumar
Sunil02kumar / gist:6a57b219b845d5bf2062
Created March 31, 2015 17:02
Custom Object info using Tooling API
Apex Code:
HttpRequest req = new HttpRequest();
req.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionID());
req.setHeader('Content-Type', 'application/json');
String domainUrl=URL.getSalesforceBaseUrl().toExternalForm();
system.debug('********domainUrl:'+domainUrl);
req.setEndpoint(domainUrl+'/services/data/v28.0/tooling/query/?q=Select+id,DeveloperName,Sharingmodel,NamespacePrefix+from+CustomObject');
req.setMethod('GET');
@niksumeiko
niksumeiko / git.migrate
Last active July 24, 2026 07:03
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@xjsender
xjsender / ApexOrg2Org
Last active June 13, 2023 04:03 — forked from richardvanhook/ApexOrg2Org
Apex SOAP Login
/*
======================================================================
The following apex code demonstrates logging into another salesforce
org via the SOAP/XML web service api and then using session id to
query the standard REST API as well as the Chatter REST API.
To run this code, simply copy and paste into execute anonymous,
then replace the value of the first three variables accordingly.
NOTES:
(1) You'll need to create a remote site setting for both the login