Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
const testArea = document.querySelector('#test-area') | |
const theTimer = document.querySelector('.timer') | |
const resetButton = document.querySelector('#reset') | |
const templateText = document.querySelector('#origin-text p') | |
var myTikTok; | |
const control = { | |
templateText: templateText.innerText, | |
isRunningTiming: false, |
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
link: | |
https://developer.github.com/v4/explorer/ | |
query { | |
repository(name:"linux" owner:"torvalds"){ | |
name | |
defaultBranchRef { | |
id | |
} | |
object(expression: "master") { |
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
import { useState } from 'react'; | |
import { useCommitLocalUpdate } from '../../components/utils/relay'; | |
function loadOrRefreshChat(opened: boolean) { | |
if (window.HubSpotConversations.widget.status().loaded === true) { | |
window.HubSpotConversations.widget.refresh(); | |
} else { | |
window.HubSpotConversations.widget.load({ widgetOpen: opened }); | |
} |
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
def get_max_brute_force(lst): | |
if len(lst) == 1: | |
return lst[0] | |
maximum = lst[0] | |
for i in range(1, len(lst)): | |
if lst[i] > maximum: | |
maximum = lst[i] |
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
def mergesort(lst): | |
'''Recursively divides list in halves to be sorted''' | |
if len(lst) == 1: | |
return lst, 0 | |
middle = len(lst) / 2 | |
left = mergesort(lst[:middle])[0] # Ignore intermediate splits | |
right = mergesort(lst[middle:])[0] # Ignore intermediate splits | |
sortedlist, splits = merge(left, right) | |
return sortedlist, splits |
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
def exp(a, n): | |
if n <= 0: | |
return 1 | |
if n % 2 == 0: | |
return exp(a, n / 2) * exp(a, n / 2) | |
else: | |
return exp(a, (n - 1) / 2) * exp(a, (n - 1) / 2) * a | |
if __name__ == '__main__': |
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
def find_peak(elements): | |
if len(elements) < 0: | |
return None | |
if len(elements) == 1: | |
return elements[0] | |
if len(elements) == 2: | |
if elements[0] > elements[1]: | |
return elements[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
#!/usr/local/bin/python2.7 | |
# encoding: utf-8 | |
import numpy as np | |
def equal_letters_strings(X, Y): | |
N = len(X) | |
M = len(Y) |
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
def maxProfit(prices): | |
if len(prices) < 2: | |
return 0 | |
s0 = dict() | |
s1 = dict() | |
s2 = dict() | |
s0[0] = 0 | |
s1[0] = -prices[0] | |
s2[0] = 0 |
NewerOlder