Skip to content

Instantly share code, notes, and snippets.

:octocat:

Brian Bier brianbier

:octocat:
Block or report user

Report or block brianbier

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@brianbier
brianbier / getidofRecords.txt
Created Feb 14, 2020
New way of creating a map from recently inserted records
View getidofRecords.txt
//After Inserting opportunities
List<Opportunity> opptys = new List<Opportunity>();
insert opptys;
// Get the IDs of the opportunities we just inserted
Map<Id, Opportunity> opptyMap = new Map<Id, Opportunity>(opptys);
//This will create a map of the opportunities
// Will allow you to do this
List<Id> opptyIds = new List<Id>(opptyMap.keySet());
@brianbier
brianbier / eventCreation.txt
Created Nov 19, 2019
All possible Options for creating an event, Since It doesn't work for regular lightning components
View eventCreation.txt
window.open('/lightning/o/Event/new');
var urlEvent = $A.get("e.force:navigateToURL");
urlEvent.setParams({
"url": "/lightning/o/Event/new"
});
urlEvent.fire();
var createRecordEvent = $A.get("e.force:createRecord");
createRecordEvent.setParams({
@brianbier
brianbier / salesforce.js
Created Jul 14, 2019 — forked from cweems/salesforce.js
Salesforce Message Push
View salesforce.js
exports.handler = function(context, event, callback) {
//================================================================================
// Modules
//================================================================================
var querystring = require('querystring');
var request = require('request');
//================================================================================
@brianbier
brianbier / vim-heroku.sh
Created Nov 25, 2018 — forked from dvdbng/vim-heroku.sh
Run vim in heroku updated 2017
View vim-heroku.sh
mkdir ~/vim
cd ~/vim
# Staically linked vim version compiled from https://github.com/ericpruitt/static-vim
# Compiled on Jul 20 2017
curl 'https://s3.amazonaws.com/bengoa/vim-static.tar.gz' | tar -xz
export VIMRUNTIME="$HOME/vim/runtime"
export PATH="$HOME/vim:$PATH"
cd -
@brianbier
brianbier / Lookup.cmp.html
Created Jun 22, 2018 — forked from JitendraZaa/Lookup.cmp.html
Salesforce Lightning Lookup component - Pure SLDS and Javascript based
View Lookup.cmp.html
<aura:component controller="Lookup">
<aura:attribute Name="selItem" type="object" access="public"
description="This attribute can be used by parent component to read selected record"/>
<aura:attribute Name="server_result" type="object[]" access="private" />
<aura:attribute name="lookupIcon" type="String" access="public" default="standard:contact"/>
<aura:attribute name="objectName" type="String" access="public"
description="Name of Object to be searched"/>
<aura:attribute name="field_API_text" type="String" access="public"
@brianbier
brianbier / progressRing.cmp
Created Jun 13, 2018 — forked from brianmfear/progressRing.cmp
LightningProgressRing component
View progressRing.cmp
<aura:component >
<aura:attribute name="value" type="Integer" default="0" />
<aura:attribute name="variant" type="String" />
<aura:attribute name="hasVariant" type="Boolean" access="private" default="{!false}" />
<aura:attribute name="ringClass" type="String" access="private" />
<aura:attribute name="iconName" type="String" access="private" />
<aura:attribute name="altText" type="String" access="private" />
<aura:handler name="init" value="{!this}" action="{!c.updateView}" />
@brianbier
brianbier / progressRing.cmp
Created Jun 13, 2018 — forked from brianmfear/progressRing.cmp
LightningProgressRing component
View progressRing.cmp
<aura:component >
<aura:attribute name="value" type="Integer" default="0" />
<aura:attribute name="variant" type="String" />
<aura:attribute name="hasVariant" type="Boolean" access="private" default="{!false}" />
<aura:attribute name="ringClass" type="String" access="private" />
<aura:attribute name="iconName" type="String" access="private" />
<aura:attribute name="altText" type="String" access="private" />
<aura:handler name="init" value="{!this}" action="{!c.updateView}" />
View Rails Zombie Spring
Just a quick note on the problem a couple of you were having yesterday where a rails generator appeared not to
be creating files. A zombie "spring" process from a different project was still running and so the generator was
actually writing files into a different application.
You can read about what spring does here: https://github.com/rails/spring The short version is that it's an application
preloader that makes running certain tasks faster by keeping parts of your app loaded in memory.
This makes things like running your tests faster as the app doesn't have to load from scratch every time.
If you don't want an app to use it, pass --skip-spring as an option to rails new.
@brianbier
brianbier / gh_script.rb
Created Jun 12, 2016 — forked from ltw/gh_script.rb
A script to check GitHub's status.
View gh_script.rb
require 'json'
require 'net/http'
status = nil
until status == 'good'
url = URI('https://status.github.com/api/status.json')
response = Net::HTTP.get(url)
body = JSON.parse(response)
p body
status = body['status']
View Web Performances
# Web App Performance
## Back End
### N+1
```
@posts = Post.all
# …
@post.each do |post|
puts post.comments.count
You can’t perform that action at this time.