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 | |
# | |
# git prepare-commit-msg hook for automatically prepending an issue key | |
# from the start of the current branch name to commit messages. | |
# check if commit is merge commit | |
if [ $2 = "merge" ]; then | |
exit | |
fi | |
ISSUE_KEY=`git branch | grep -o "\* \(.*/\)*[A-Z]\{2,\}-[0-9]\+" | grep -o "[A-Z]\{2,\}-[0-9]\+"` |
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
cd submodule_directory | |
git checkout v1.0 | |
cd .. | |
git add submodule_directory | |
git commit -m "moved submodule to v1.0" | |
git push |
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 shutil | |
import requests | |
from bs4 import BeautifulSoup | |
from tinypng import shrink_file | |
requests.packages.urllib3.disable_warnings() | |
response = requests.get("YOUR_URL") | |
soup = BeautifulSoup(response.text, 'html.parser') | |
images = soup.find_all('img') |
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
perl -MMIME::Base64 -ne 'print decode_base64($_)' < YOUR_FILE.eml |
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
@echo off | |
set loops=0 | |
set process=%1 | |
:WaitForProcessToStart | |
if /i %loops% gtr 10 ( | |
echo Process didn't started on time | |
exit /b 1 | |
) |
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
select sysobj.name, sum(reserved_page_count) * 8.0 / 1024 as 'total size (MB)' | |
from sys.dm_db_partition_stats sysstats, sys.objects sysobj | |
where sysstats.object_id = sysobj.object_id and sysobj.schema_id = schema_id('dbo') | |
group by sysobj.name; |
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
SELECT Convert(datetime, SWITCHOFFSET(CONVERT(datetimeoffset,[ColumnWithUTCTime]), DATENAME(TzOffset, SYSDATETIMEOFFSET()))) AS LocalTime | |
FROM TABLE |
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 | |
set -e | |
# Keypairs | |
echo "Finding Key Pairs..." | |
KEY_PAIRS_JSON=`aws ec2 describe-key-pairs --filters 'Name=key-name,Values=packer*'` | |
KEY_PAIRS=`echo "${KEY_PAIRS_JSON}" | grep 'KeyName' |sed -e 's/.*"KeyName": "//' -e 's/",* *$//'` | |
# Security Groups |
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
rm -Rf |
OlderNewer