Skip to content

Instantly share code, notes, and snippets.

View orlybg's full-sized avatar

Orlando Briceño Gómez orlybg

View GitHub Profile
import { LightningElement, track} from 'lwc';
// importing apex class to make callout
import getSomething from '@salesforce/apex/MyAPIstuff.retrieve';
import startRequest from '@salesforce/apexContinuation/MyAPIstuff.startRequest';
export default class MyAPIstuff extends LightningElement {
@track token;
@track imperativeContinuation = {};
Basic navigation & Editing
- Install VS Code https://code.visualstudio.com/download
- Install Salesforce extension pack https://marketplace.visualstudio.com/items?itemName=salesforce.salesforcedx-vscode
- VS Code shell command
- VS Code project / directory search
- VS Code Marketplace
- VS Code CSV
- VS Code multiline editing https://stackoverflow.com/questions/30037808/multiline-editing-in-visual-studio-code 
search and edit: ctrl + f & alt + enter
add cursor: alt + cmd + arrows
add cursor: shift + option + click
- VS Code code formatting
- VS Code split screen
<aura:iteration items="{!v.keyAccs}" indexVar="idx" var="keyAcc" >
<tr keyAccId="{!keyAcc.Id}" data-record="{!keyAcc.Id}" data-index="{!idx}">
<td>
<l_lookup:Lookup objectType="Account"
selectedRecordId = "{!keyAcc.Account__c}"
readonly = "false">
</l_lookup:Lookup>
</td>
http://6dollarshirts.com/sleep-of-reason
http://6dollarshirts.com/nine-and-three-quarters
http://6dollarshirts.com/rebellion-princess
http://6dollarshirts.com/cat-commands
http://6dollarshirts.com/made-in-the-80s
http://6dollarshirts.com/atomic-science
http://6dollarshirts.com/namaste-bitches
http://6dollarshirts.com/history-buff
http://6dollarshirts.com/thoreau-quote
http://6dollarshirts.com/coexist
@orlybg
orlybg / gist:79bd8e051d02e4d61cffe60fbd761bb0
Created May 10, 2016 12:48 — forked from jmertic/gist:5847575
Sample Node.js script using Restler for connecting to the new RESTful SugarCRM REST API in 6.7 and later.
var sys = require('util'),
rest = require('restler');
var baseurl = "<<instance URL>>/rest/v10"
// get oAuth token
var jsonData = {"grant_type":"password","username":"<<username>>","password":"<<password>>","client_id":"sugar"};
rest.postJson(baseurl+'/oauth2/token', jsonData).on('2XX', function(data) {
if ( data.error ) {
sys.puts("Error: " + data.error_message);
@orlybg
orlybg / update_via_csv.php
Created January 28, 2016 13:20 — forked from bickart/update_via_csv.php
Place this file and your CSV file into the root of your SugarCRM install and you can update data in SugarCRM from a CSV on the command line
<?php
//Use an unlimited amount of memory, we probably shouldn't do this but that is how I roll
ini_set('memory_limit', '-1');
//Our program allows us to skip over rows in the data file and only load a sub-set of rows
if (count($argv) < 3 || ! is_numeric($argv[1]) || ! is_numeric($argv[2])) {
echo "Usage php -f $argv[0] skip max" . PHP_EOL;
echo " skip - number of rows to skip when processing" . PHP_EOL;
echo " max - number of rows to import when processing" . PHP_EOL;
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-1.9.1.min.js"></script>
<meta charset="utf-8">
<title>DBdiff!</title>
<meta name="description" content="Database diff tool">
<link rel="stylesheet" href="dbdiff.css">
*{ BEGIN: We include the locale features file incase we want to remove locale specfic features. }*
% { try { } %
#{include messages.get('localeConfig.path').raw() /}
% { }catch(Exception e) { } %
<script type="text/javascript">alert("Something bad with localeConfig.path"); </script>
%{ } }%
*{ END }*
=begin
Sample code to read in test cases:
File.open(ARGV[0]).each_line do |line|
# Do something with line, ignore empty lines
#...
end
=end
File.open(ARGV[0]).each_line do |line|
# Do something with line, ignore empty lines
@orlybg
orlybg / ruby_resources
Created July 2, 2013 16:40
List o ruby/rails resources links
RUBY
webcasts
http://railscasts.com/episodes/194-mongodb-and-mongomapper
http://railscasts.com/episodes/279-understanding-the-asset-pipeline
http://railscasts.com/episodes/17-habtm-checkboxes-revised
http://railscasts.com/episodes/238-mongoid
https://github.com/cavalle/steak
https://github.com/seyhunak/twitter-bootstrap-rails
http://railscasts.com/episodes/348-the-rails-api-gem