This file contains hidden or 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
.image { | |
position: relative; | |
background: #f5f5f5; | |
max-width: 100%; | |
max-height: 100%; | |
overflow: hidden; | |
} | |
.image:after { |
This file contains hidden or 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
.row { | |
display: -webkit-box; | |
display: -webkit-flex; | |
display: -ms-flexbox; | |
display: flex; | |
flex-wrap: wrap; | |
} | |
.row > [class*='col-'] { | |
display: flex; |
This file contains hidden or 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
''' Firefox Driver options ''' | |
options = webdriver.FirefoxOptions() | |
# disable push notifications | |
options.set_preference("dom.push.enabled", False) | |
# maximize window size | |
driver.maximize_window() |
This file contains hidden or 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
# find folder location by folder name | |
dir=$(sudo find $HOME -type d -name folderName) | |
cd $dir | |
# print file data that starts from specific text | |
cat .flake8 | sed -n -e '/exclude = /,$p' |
This file contains hidden or 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 getStyle = (el, ruleName) => getComputedStyle(el)[ruleName]; | |
getStyle(document.querySelector('p'), 'font-size'); // '16px' |
This file contains hidden or 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
If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) | |
{ | |
$arguments = "& '" + $myinvocation.mycommand.definition + "'" | |
Start-Process powershell -Verb runAs -ArgumentList $arguments | |
Break | |
} | |
This file contains hidden or 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
/* Common Regular Expressions */ | |
// Match domain (com,net,ru) | |
let url = "https://www.youtube.com/watch?v=vEPOU_fKmR8"; | |
url.match(/^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i); | |
let site = matches && matches[1]; |
This file contains hidden or 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
# Note Microsoft Excel must be installed | |
from openpyxl import Workbook, load_workbook | |
from win32com.client import Dispatch | |
path = os.path.dirname(os.path.abspath(__file__)) | |
o = Dispatch("Excel.Application") | |
o.Visible = False | |
o.DisplayAlerts = False |
This file contains hidden or 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 org.json.simple.JSONObject; | |
import org.json.simple.parser.JSONParser; | |
import org.json.simple.parser.ParseException; | |
public static JSONObject readJSON(String file) throws IOException, ParseException { | |
JSONParser parser = new JSONParser(); | |
FileReader config = new FileReader(file); | |
Object obj = parser.parse(config); | |
return (JSONObject) obj; |
This file contains hidden or 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 chunks(lst, n): | |
for i in range(0, len(lst), n): | |
yield lst[i:i + n] | |
lst = [1,3,5,6,7,9,5,4,2,3,5,6,7,4,3] | |
res = list(chunks(lst, 3)) | |
print(res) # [[1, 3, 5], [6, 7, 9], [5, 4, 2], [3, 5, 6], [7, 4, 3]] |