Skip to content

Instantly share code, notes, and snippets.

Avatar

Miša Mаkaröv micmmakarov

View GitHub Profile
@micmmakarov
micmmakarov / game.js
Created Aug 5, 2020
Comedy game with flying
View game.js
// Declaration of constants
levels = [
{
title: "1: You make your coworkers laugh",
score: 0,
max: 30,
emoji: {
bomb: 9,
drink: 30,
@micmmakarov
micmmakarov / describe-lwc-component.js
Last active Jan 24, 2019
Scans the WLC component for it's API
View describe-lwc-component.js
// node describe-lwc-component.js ~/path/to/file
String.prototype.padding = function(n, c)
{
var val = this.valueOf();
if ( Math.abs(n) <= val.length ) {
return val;
}
var m = Math.max((Math.abs(n) - this.length) || 0, 0);
var pad = Array(m + 1).join(String(c || ' ').charAt(0));
@micmmakarov
micmmakarov / cherrychecker.rb
Created Jan 11, 2018
Script that checks if there're any forgotten cherrypicks
View cherrychecker.rb
require 'json'
# run from git repo. Make sure to pull first
# EXAMPLE
# cd MY_LIGHTNING_GLOBAL_GIT_FOLDER
# ~/cherrychecker.rb
# ~/cherrychecker.rb email=mmakarov@salesforce.com
# ~/cherrychecker.rb --slack
# ~/cherrychecker.rb compare=212-patch
View go_comfy_bot.js
warmMySpaceIfSomeoneMadeAColdRequest = function() {
last_request_is_make_cold = $($('.activity-grid .activity-grid-row.ng-scope')[0]).find('img').attr('src').includes('toohot');
if (last_request_is_make_cold) {
$(".btn-warm").click();
console.log("Someone triggered cold request. But don't worry, I'll heat it up for you!");
} else {
console.log('Last request was not the cold request');
}
}
@micmmakarov
micmmakarov / sudoku_ninja.js
Last active Feb 8, 2017
Fast Sudoku validator in Javascript via array addresses
View sudoku_ninja.js
/*
Fast JS Sudoku validator implemented in Javascript via array addresses.
Check whether a 9x9 sudoku board is valid.
Sudoku is a game played on a 9x9 grid. The object of the game is to fill in every square on the grid with a number, 1-9, so that:
Every row contains the numbers 1-9
Every column contains the numbers 1-9
@micmmakarov
micmmakarov / throttle_puzzle.rb
Last active Oct 12, 2016
Solution for throttle puzzles
View throttle_puzzle.rb
class GetShots
def initialize(rate_limit, time_window)
@rate_limit = rate_limit
@time_window = time_window
@calls_count = 0
end
def get_shot(type, params)
@calls_count += 1
@invoked_at ||= Time.now
View gist:d73fafdcbbf627d0c0ec449cea0bde0f
scoped_key = Keen::ScopedKey.new('KEEN_MASTER_KEY', allowed_operations: ["read"], filters: [{ # master_key should be a variable that contains your Keen master key
'property_name' => 'company.id',
'operator' => 'eq',
'property_value' => current_company.id # current_user.id should be a variable that contains the customer ID
}]).encrypt!
View Keen Event Data
{
message:{
id:1,
direction:"sent",
via_api:false,
type:"FacebookMessage"
},
customer:{
id:16
},
View Test
require 'spec_helper'
require 'pry'
require 'pry-nav'
include Warden::Test::Helpers
feature 'Propack Order', :js => true do
background do
user = Factory.create(:user)
login_as(user, :scope => :user)
View gist:4720165
require "spec_helper"
puts "Hello, world!"
feature %q{
As a user
I want to be able to create
New Meetings
} do