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
trigger: | |
branches: | |
include: | |
- develop | |
- master | |
paths: | |
include: | |
- ./ | |
resources: |
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 | |
page_link ='https://www.website_to_crawl.com' | |
# fetch the content from url | |
page_response = requests.get(page_link, timeout=5) | |
# parse html | |
page_content = BeautifulSoup(page_response.content, "html.parser") | |
# extract all html elements where price is stored | |
prices = page_content.find_all(class_='main_price') |
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
# https://stackoverflow.com/questions/6543519/undoing-accidental-git-stash-pop | |
# https://stackoverflow.com/questions/89332/how-to-recover-a-dropped-stash-in-git | |
accepted | |
If you have only just popped it and the terminal is still open, you will still have the hash value printed by git stash pop on screen (thanks, Dolda). | |
Otherwise, you can find it using this for Linux and Unix: | |
git fsck --no-reflog | awk '/dangling commit/ {print $3}' | |
and for Windows: |
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
# Danish "CVR-nummer". | |
# | |
# A 7 digit serial number followed by a mod-11 check digit: | |
# https://erhvervsstyrelsen.dk/modulus-11-kontrol | |
# | |
# Search for real CVRs, to see examples: https://datacvr.virk.dk/data/ | |
# E.g. 35408002, 30715063. | |
class DanishOrganizationNumber | |
MOD_11_WEIGHTS = [ 2, 7, 6, 5, 4, 3, 2 ] |
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
#!/bin/sh | |
wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.24-osx10.9-x86_64.tar.gz | |
tar xfvz mysql-5.6* | |
echo "stopping mamp" | |
sudo /Applications/MAMP/bin/stop.sh | |
sudo killall httpd mysqld | |
echo "creating backup" |
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
/** | |
* VH and VW units can cause issues on iOS devices: http://caniuse.com/#feat=viewport-units | |
* | |
* To overcome this, create media queries that target the width, height, and orientation of iOS devices. | |
* It isn't optimal, but there is really no other way to solve the problem. In this example, I am fixing | |
* the height of element `.foo` —which is a full width and height cover image. | |
* | |
* iOS Resolution Quick Reference: http://www.iosres.com/ | |
*/ | |
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
// Determine if an element is in the visible viewport | |
function isInViewport(element) { | |
var rect = element.getBoundingClientRect(); | |
var html = document.documentElement; | |
return ( | |
rect.top >= 0 && | |
rect.left >= 0 && | |
rect.bottom <= (window.innerHeight || html.clientHeight) && | |
rect.right <= (window.innerWidth || html.clientWidth) | |
); |
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
#!/bin/bash | |
# | |
# The reason of creating this script is that Endpoint Security VPN installs it's own application firewall kext cpfw.kext | |
# which prevents for example PPTP connections from this computer, which is not appropriate if you need subj connection just | |
# from time to time | |
# Usage: checkpoint.sh load|unload | |
# You will need sudo power, of course | |
# | |
COMMAND=$1 |
NewerOlder