Skip to content

Instantly share code, notes, and snippets.

View akpersad's full-sized avatar

Andrew Persad akpersad

  • Deloitte Digital
  • Brooklyn, NY
View GitHub Profile
require 'pry'
#require 'awesome_print'
# Write your code here!
def game_hash
game_hash = {
:home => {
:team_name => "Brooklyn Nets",
:colors => ["Black", "White"],
require 'pry'
class PalindromeFinder
def initialize(string)
# code here
@string = string
end
def get_longest_palindrome
if @string.length >= 1
@akpersad
akpersad / PagingSortingController.cls
Created February 28, 2018 19:28 — forked from brianmfear/PagingSortingController.cls
Lightning Paging and Sorting Demo
global class PagingSortingController {
@AuraEnabled global static Account[] getAccounts() {
return [SELECT Name, Industry, AnnualRevenue FROM Account LIMIT 1000];
}
}
@akpersad
akpersad / PagingSortingController.cls
Created February 28, 2018 19:29 — forked from brianmfear/PagingSortingController.cls
Lightning Paging and Sorting Demo
global class PagingSortingController {
@AuraEnabled global static Account[] getAccounts() {
return [SELECT Name, Industry, AnnualRevenue FROM Account LIMIT 1000];
}
}
javascript: (function() {
var styleEl = document.getElementById('css-layout-hack');
if (styleEl) {
styleEl.remove();
return;
}
styleEl = document.createElement('style');
styleEl.id = 'css-layout-hack';
styleEl.innerHTML = '* { background:#000!important;color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }\
* * { background-color: rgba(0,255,0,.2) !important; }\
const numChecker = (num, min, max) => (num < min ? min : num > max ? max : num);
const rgb2hsv = (r, g, b) => {
let rabs, gabs, babs, rr, gg, bb, h, s, v, diff, diffc, percentRoundFn;
rabs = r / 255;
gabs = g / 255;
babs = b / 255;
(v = Math.max(rabs, gabs, babs)), (diff = v - Math.min(rabs, gabs, babs));
diffc = (c) => (v - c) / 6 / diff + 1 / 2;
percentRoundFn = (num) => Math.round(num * 100) / 100;