This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
init: function(elevators, floors) { | |
const DIR_UP = 'up'; | |
const DIR_DOWN = 'down'; | |
const pendingPickupDirectionDownFloors = new Set(); | |
const pendingPickupDirectionUpFloors = new Set(); | |
const buttonPressedHandlerFactory = (floor, direction) => () => { | |
console.log(`Button pressed on floor ${floor.floorNum()} going ${direction}`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Reverse Engineered from | |
// https://github.com/stripe/stripe-ios/blob/d4e3170fab9ab940816ea28ea8084b48a842e764/Stripe/STPAPIClient%2BApplePay.m#L22-L28 | |
class StripeToken { | |
// IPaymentResponse is the response from `makePayment()` | |
public async getTokenFromPaymentData(payment: IPaymentResponse) { | |
const payload: any = { | |
pk_token: atob(payment.paymentData), | |
...this.addressParamsFromPaymentData(payment), | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ion-back-button [defaultHref]="relativeUrl('..')"></ion-back-button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.$el = $(this.element.nativeElement); | |
const scrollableBody = this.element.querySelector('.fc-content-skeleton'); | |
const scrollableHeader = this.element.querySelector('.fc-head-container > .fc-row'); | |
const scrollableBg = this.element.querySelector('.fc-bg'); | |
scrollableBody.addEventListener('scroll', () => { | |
scrollableHeader.scrollTo(scrollableBody.scrollLeft, 0); | |
scrollableBg.scrollTo(scrollableBody.scrollLeft, 0); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Generated by typings | |
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/86b7c1a2688e38d8db2f53bf9949e7caec0d7630/react-select/react-select.d.ts | |
declare namespace ReactSelect { | |
interface AutocompleteResult { | |
/** the search-results to be displayed */ | |
data: Option[], | |
/** Should be set to true, if and only if a longer query with the same prefix | |
* would return a subset of the results | |
* If set to true, more specific queries will not be sent to the server. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.config(['$provide', ($provide) => { | |
$provide.decorator('$log', ($delegate) => { | |
let wrapper = {}; | |
Object.keys($delegate).forEach((key) => { | |
let delegateFn = $delegate[key]; | |
let remoteFn = console.re[key]; | |
wrapper[key] = () => { | |
delegateFn.apply(delegateFn, arguments); | |
remoteFn.apply(remoteFn, arguments); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium.webdriver.common.by import By | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.support import expected_conditions as EC | |
from selenium.common.exceptions import NoSuchElementException | |
class BaseTestClass(object): | |
def __init__(self, driver): | |
self.wait = WebDriverWait(driver, 5, .25, (NoSuchElementException,)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.utils.decorators import method_decorator | |
from django.views.decorators.csrf import ensure_csrf_cookie | |
class EnsureCsrfCookieMixin(object): | |
@method_decorator(ensure_csrf_cookie) | |
def dispatch(self, *args, **kwargs): | |
return super(EnsureCsrfCookieMixin, self).dispatch(*args, **kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"color_scheme": "Packages/User/Monokai (SL).tmTheme", | |
"ensure_newline_at_eof_on_save": true, | |
"font_size": 12, | |
"ignored_packages": | |
[ | |
"Vintage" | |
], | |
"indent_to_bracket": true, | |
"shift_tab_unindent": true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
import sys | |
# Gives you a github style diffstats. | |
# With the ability to exclude paths for more relevancy. | |
# | |
# Generate a diffstat file with: | |
# git diff --numstat master...HEAD > stats.diff | |
# |
NewerOlder