Skip to content

Instantly share code, notes, and snippets.

@winniecluk
winniecluk / project_code_review.md
Last active September 2, 2016 19:41
Project 1 Code Review

Here is the code that creates new spiders. Is there another way I could have done this?

function replaceSpiders(){
  regenerateID = setInterval(function(){
    $('.spider-column').each(function(ind, column){
      $(this).html('');
      var result = getRandom();
      var resultID = getRandom3();
 if (result == 1){
@winniecluk
winniecluk / gist:27bf628e14cc99e08f29dea2f51b4fca
Created September 23, 2016 20:18
Code in model that doesn't work the way I want it to
hello
@AuraEnabled
public static String getUserName(String i){
String firstName = UserInfo.getFirstName();
String lastName = UserInfo.getLastName();
String fullName = firstName + ' ' + lastName;
return fullName;
}
for(Event e : [SELECT Id, Provider__c, Provider__r.FirstName, Provider__r.LastName, Room__c, Location__c, Status__c, Insurance__c, Appointment_Type__c,
StartDateTime, EndDateTime, Subject, Description, What.Name, Who.Account_Frequency__c, Room_Name__c
FROM Event WHERE ActivityDate = : newDate AND Provider__c IN : userMap.keySet()] ){
userMap.get(e.Provider__c).addEvent(e);
}
<script>
$Lightning.use("c:accountEquipmentApp", function() {
$Lightning.createComponent(
"c:accountEquipment",
{ recordId : "{!Account.Id}" },
"lightning",
function() {
$A.eventService.addHandler({ "event": "c:redirectToRecord", "handler" : redirectPage});
}
);
public static Set<String> storedTargetIds = new Set<String>();
public static void beforeInsert(List<Referral__c> newList){
List<Target__c> targetsList = [SELECT Id,Start_Date__c,End_Date__c FROM Target__c];
for (Referral__c r : newList){
if (r.Date__c != null){
Date referralDate = r.Date__c;
for (Target__c target : targetsList){
global with sharing class LP_Dashboard_Controller {
public Opportunity record {get;set;}
// public LP_Dashboard_Controller(ApexPages.standardController standardController){
// this.record = (Opportunity)standardController.getRecord();
// if ( record.Id != null ){
// //util.queryRecord(record.Id);
// }
// }
<apex:page controller="LP_Dashboard_Controller">
<style>
/** {
border: 1px solid red;
}*/
.flex-around {
display: flex;
<aura:if isTrue="{!property.Total_Funding_to_Date__c &amp;&amp; property.Sold_Price__c}">
<ui:outputNumber value="{!(property.Total_Funding_to_Date__c / property.Sold_Price__c) * 100}" format=".00" />%
</aura:if>
if (pmrList.size() > 0){
upsert pmrList;
// find event from eventList that has its id stored in pmr\'s account_c field
// store pmr id in event\'s pmr id field
for (PM_R_Treatment__c pmr : pmrList){
for (Event e : eventList){
if (e.AccountId == pmr.Account__c){
e.PMRId__c = pmr.Id;