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
use std::cmp::Ordering; | |
pub struct SortablePoint<'a>(pub &'a RetrievedPoint); | |
pub fn get_value(kind: &Kind) -> Option<String> { | |
match kind { | |
Kind::NullValue(_) => None, | |
Kind::DoubleValue(value) => Some(value.to_string()), | |
Kind::IntegerValue(value) => Some(value.to_string()), |
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 subprocess | |
class Surya: | |
def __init__(self, contract_path): | |
self.contract_path = contract_path | |
self.command = 'surya' | |
def _run_command(self, arguments): | |
result = subprocess.run([self.command] + arguments, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True).stdout |
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 json | |
def is_single_file_contract(source_code: str) -> bool: | |
return ( | |
source_code.startswith("pragma") or | |
source_code.startswith("//") or | |
source_code.startswith("\r\n") or | |
source_code.startswith("/*") | |
) |
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
.wsr-top-button-block { | |
display: none; | |
margin-bottom: 1em; | |
} | |
.wsr-top-button-block > a{ | |
white-space: normal; | |
font-weight: 300; | |
} | |
@media (min-width: @screen-xs) and (max-width: @screen-xs-max) { |
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
handleScroll() { | |
let anchor = 120; | |
let value = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0; | |
let tensor = (1/(value/anchor))*7 - 1.8 * ((value/anchor) - 1); | |
let point = value > anchor ? ( tensor > 0 ? tensor : 0 ): 7; | |
if (this.scrollIcon !== null) { | |
this.scrollIcon.setAttribute('points', '0 1,0.5 1,0.67 ' + point/87.5 + ',1 0,0 0'); | |
} | |
if (this.Affix !== null) { |
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
<configuration> | |
<system.webServer> | |
<staticContent> | |
<mimeMap fileExtension="woff" mimeType="application/font-woff" /> | |
<mimeMap fileExtension="woff2" mimeType="application/font-woff" /> | |
</staticContent> | |
</system.webServer> | |
</configuration> |
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
/* styles for '...' */ | |
.block-with-text { | |
/* hide text if it more than N lines */ | |
overflow: hidden; | |
/* for set '...' in absolute position */ | |
position: relative; | |
/* use this value to count block height */ | |
line-height: 1.2em; | |
/* max-height = line-height (1.2) * lines max number (3) */ | |
max-height: 4.8em; |
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 bs4 import BeautifulSoup | |
import requests | |
import re | |
page = requests.get('https://www.rentaphoto.com/rentaphototv') | |
soup = BeautifulSoup(page.text, 'html.parser') | |
print page.status_code | |
columns = soup.findAll('a', href = re.compile('vimeo.com/\d''')) |